Comes a time in every performance-oriented programmer's life when you can speed things up tremendously by working directly with bits. In such a situation, this page of bit twiddling hacks would be very useful: Bit Twiddling Hacks (via John Lam)