Peteris Krumins writes, “Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits in an integer) by looping over individual bits, these programming nuggets do the same with one or two carefully chosen bitwise operations.”
& – bitwise and
| – bitwise or
^ – bitwise xor
~ – bitwise not
<< – bitwise shift right
>> – bitwise shift leftfun here: http://www.catonmat.net/blog/low-level-bit-hacks-you-absolutely-must-know/