floorlog2x
Floorlog2x, commonly written as floor(log2(x)), is the greatest integer less than or equal to the base-2 logarithm of x. It is defined for positive x (x > 0). By definition it satisfies 2^k <= x < 2^(k+1), where k = floor(log2(x)). Thus floorlog2x returns the exponent of the highest power of two not exceeding x.
For integer inputs, floorlog2x also equals the index of the most-significant 1 bit in the binary representation
Computing floorlog2x can be done in several ways. A straightforward approach uses a logarithm function and
Common applications include algorithm analysis and data structure design, such as determining the number of iterations