log2

Function log2 

Source
pub const fn log2(n: usize) -> usize
Expand description

Compute the base 2 log of a number, rounded down to the nearest integer.

ยงExample

assert_eq!(0, log2(0b1));
assert_eq!(1, log2(0b10));
assert_eq!(1, log2(0b11));
assert_eq!(3, log2(0b1011));