Operator | Result |
& | Bitwise AND |
| | Bitwise OR |
^ | Bitwise exclusive OR (XOR) |
> | Shift right |
< | Shift left |
~ | One's complement (unary NOT) |
p | q | p & q | p | q | p ^ q | ~p |
0 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 0 |
3.9.Bitwise Operator | ||||
3.9.1. | The Bitwise Operators | |||
3.9.2. | Bitwise Compound Assignments |