pub fn flooring_log2(x: usize) -> usize
Fast integer log2 that floors to the lower power-of-2 if x is not a power-of-2. x must not be 0.
log2
x
assert_eq!(flooring_log2(1), 0); assert_eq!(flooring_log2(64), 6); assert_eq!(flooring_log2(61), 5); assert_eq!(flooring_log2(4095), 11);