floorlogb
floorlogb is the function that returns the greatest integer n such that b^n ≤ x for a positive real x and a base b > 1. Equivalently, floorlogb(x) = ⌊log_b(x)⌋, where log_b is the logarithm with base b. The function is defined for x > 0 and b > 1; log bases b ≤ 0 or b = 1 are not allowed in the standard definition.
For integer values, floorlogb(n) gives the position of the most significant digit of n in base b,
In the special case b = 2, floorlog2(n) equals the index of the most significant 1 bit in
Computationally, floorlogb(x) can be obtained by evaluating the real logarithm and applying the floor function, ⌊log_b(x)⌋,