Bitwise Operators
&
“AND”
Sets each bit to 1 if both bits are 1
Ex: x & y
Bitwise Operators
|
“OR”
Sets each bit to 1 if one of two bits is 1
Ex: x | y
Bitwise Operators
“XOR”
Sets each bit to 1 if only one of two bits is 1
Ex: x ^ y
Bitwise Operators
~
“NOT”
Inverts all the bits
Ex: ~x
Bitwise Operators
«
“Zero fill left shift”
Shift left by pushing zeros in from the right and let the leftmost bits fall off
Ex: x «_space;2