& | (Bitwise AND) Returns a one in each bit position if bits of both operands are ones. The Bitwise AND operator is used as follows: a & b Returns a one in each bit position if bits of both operands are ones. |
^ | (Bitwise XOR) Returns a one in a bit position if bits of one, but not if both operands are one. The bitwise XOR operator is used as follows: a ^ b Returns a one in a bit position if bits of one, but not both operands are one. |
| | (Bitwise OR) Returns a one in a bit if bits of either operand is one. The Bitwise OR operator is used as follows: a | b Returns a one in a bit if bits of either operand is one. |
~ | (Bitwise NOT) Flips the bits of its operand. The Bitwise NOT operator is used as follows: ~ a Flips the bits of its operand. |
<< | (Left shift) Shifts its first operand in binary representation the number of bits to the left specified in the second operand, shifting in zeros from the right. The Left shift operator is used as follows: a << b Shifts a in binary representation b bits to left, shifting in zeros from the right. |
>> | (Sign-propagating right shift) Shifts the first operand in binary representation the number of bits to the right specified in the second operand, discarding bits shifted off. The Sign-propagating right shift operator is used as follows: a >> b Shifts a in binary representation b bits to right, discarding bits shifted off. |
>>> | (Zero-fill right shift) Shifts the first operand in binary representation the number of bits to the right specified in the second operand, discarding bits shifted off, and shifting in zeros from the left. The zero-fill right shift operator is used as follows: a >>> b Shifts a in binary representation b bits to the right, discarding bits shifted off, and shifting in zeros from the left. |