The floor of log₂(n) is just the index of the highest set bit — how many times you can halve n before it reaches 1. It tells you how many bits a number needs, which bucket it falls in, what power of two brackets it. The naive form counts shifts; the fast forms use a De Bruijn hash or a hardware count-leading-zeros instruction. All return the identical integer. It is the discrete logarithm every allocator, every float unpacker, and every binary-search bound quietly uses.
The demo computes ⌊log₂(37)⌋ = 5 by counting how many right-shifts bring 37 down to 1: live demo
“Logarithms are floating-point.” — the integer log2 is a bit position: no math library, just the top set bit. cited
A logarithm read straight off the bits — the highest 1’s position, by count, hash, or instruction. resource
On the canonical compiler, counting shifts of 37 down to 1 gives ⌊log₂(37)⌋ = 5 (32 ≤ 37 < 64):