What does a bitwise shift (left or right) do and what is it used for?
Here is an applet where you can exercise some bit-operations, including shifting. You have a collection of bits, and you move some of them beyond their bounds: 1111 1110 << 2 1111 1000 It is filled from the right with fresh zeros. 🙂 0001 1111 >> 3 0000 0011 Filled from the left. A special … Read more