Technology Base : Main / Bit And Number Manipulation

Bit Twiddling Hacks at Stanford University
Shows some amazingly efficient ways to sign-extend integers, count bits set, etc.

(Printable View of /wiki/index.php?n=Main.BitAndNumberManipulation)