Library for bitwise operations.
Bitwise OR
Bitwise XOR
Flip each bit individually, often called bitwise NOT
Shift bits to the left by a given offset, filling new bits with zeros. This can be used to multiply numbers by powers of two.
8 `shiftLeft` 1 == 16
8 `shiftLeft` 2 == 32Shift bits to the right by a given offset, filling new bits with whatever is the topmost bit. This can be used to divide numbers by powers of two.
32 `shiftRight` 1 == 16
32 `shiftRight` 2 == 8
-32 `shiftRight` 1 == -16This is called an arithmetic right shift, often written (>>), and sometimes called a sign-propagating right shift because it fills empty spots with copies of the highest bit.
Shift bits to the right by a given offset, filling new bits with zeros.
32 `shiftRightLogical` 1 == 16
32 `shiftRightLogical` 2 == 8
-32 `shiftRightLogical` 1 == 2147483632This is called an logical right shift, often written (>>>), and sometimes called a zero-fill right shift because it fills empty spots with zeros.
Bitwise AND