34,333
edits
Changes
no edit summary
As with the arithmetic operators, each bitwise operator has a corresponding compound operator that allows the operation and assignment to be performed using a single operator:
<table border="1" cellspacing="0">
<tr style="background:#efefef;">
<th>Operator</th><th>Description</th>
<tr>
<td>x &= y<td>Perform a bitwise AND of x and y and assign result to x</td>
<tr>
<td>x |= y<td>Perform a bitwise OR of x and y and assign result to x</td>
<tr>
<td>x ^= y<td>Perform a bitwise XOR of x and y and assign result to x</td>
<tr>
<td>x <<= n<td>Shift x left by n places and assign result to x</td>
<tr>
<td>x >>= n<td>Shift x right by n places and assign result to x</td>
</tr>
</table>