The integer part of the base-two logarithm of
n
is the number of times you can divide by two before you get a number less than 2.