fn log2floor(mut n: u32) -> u32 {
    let mut val: u32 = 0_u32;
    while n > 1_u32 {
        n = n.wrapping_div(2_u32);
        val = val.wrapping_add(1)
    }
    val
}
/*
 * Computes the log2 of the max power of 2 <= n
 */
Computes the log2 of the max power of 2 <= n
Computes the log2 of the max power of 2 < = n
fn log2floor(mut n: u32) -> u32 {
    let mut val: u32 = 0_u32;
    while n > 1_u32 {
        n = n.wrapping_div(2_u32);
        val = val.wrapping_add(1)
    }
    val
}
fn log2floor ( mut n : u32 ) -> u32 { let mut val : u32 = 0_u32 ; while n > 1_u32 { n = n . wrapping_div ( 2_u32 ) ; val = val . wrapping_add ( 1 ) } val }
Computes the log2 of the max power of 2 <= n
Computes the log2 of the max power of 2 < = n
n
u32