Init.Data.Nat.Log2
source
Computes ⌊max 0 (log₂ n)⌋.
⌊max 0 (log₂ n)⌋
log2 0 = log2 1 = 0, log2 2 = 1, ..., log2 (2^i) = i, etc.
log2 0 = log2 1 = 0
log2 2 = 1
log2 (2^i) = i