Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 690 Bytes

File metadata and controls

29 lines (24 loc) · 690 Bytes

bitwise operators


Back

Bitwise operators handle every bit inside a variable individually.

&  /* (a &  b) bitwise and */
|  /* (a |  b) bitwise or */
^  /* (a ^  b) bitwise exclusive or */
~  /* (a ~  b) bitwise not (one's complement) */
<< /* (a << b) shift a left for b bits */
>> /* (a >> b) shift a right for b bits */ /*
|      |       |
|      |       *-description
|      |
|      *-example
|
*-operator
a b a & b a | b a ^ b
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0