Changes

Jump to: navigation, search

Ruby Operator Precedence

18 bytes added, 18:29, 19 November 2007
Operator Precedence Table
<td>Element reference, element set</td>
</tr><tr>
<td>YYes</td>
<td><code>**</code></td>
<td>Exponentiation (raise to the power)</td>
</tr><tr>
<td>YYes</td>
<td><code>!</code> <code>~</code> <code>+</code> <code>-</code></td>
<td>Not, complement, unary plus and minus (method names for the last two are <code>+@</code> and <code>-@</code>)</td>
</tr><tr>
<td>YYes</td>
<td><code>*</code> <code>/</code> <code>%</code></td>
<td>Multiply, divide, and modulo</td>
</tr><tr>
<td>YYes</td>
<td><code>+</code> <code>-</code></td>
<td>Addition and subtraction</td>
</tr><tr>
<td>YYes</td>
<td><code>&gt;&gt;</code> <code>&lt;&lt;</code></td>
<td>Right and left bitwise shift</td>
</tr><tr>
<td>YYes</td>
<td><code>&amp;</code></td>
<td>Bitwise `AND'</td>
</tr><tr>
<td>YYes</td>
<td><code>^</code> <code>|</code></td>
<td>Bitwise exclusive `OR' and regular `OR'</td>
</tr><tr>
<td>YYes</td>
<td><code>&lt;=</code> <code>&lt;</code> <code>&gt;</code> <code>&gt;=</code></td>
<td>Comparison operators</td>
</tr><tr>
<td>YYes</td>
<td><code>&lt;=&gt;</code> <code>==</code> <code>===</code> <code>!=</code> <code>=~</code> <code>!~</code></td>

Navigation menu