Finding the most-significant bit in constant time, independent of word size
keithschwarz.com