Another great resource for tidbits like this is _Hacker's Delight_, by Henry S. Warren, Jr. It covers a number of other tricks outside of bit twiddling, as well. Worth checking out for anyone who finds this sort of stuff fascinating.
Link: http://www.amazon.com/Hackers-Delight-Henry-S-Warren/dp/0201...