dsalgo 0.3.10

A package for Datastructures and Algorithms.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// O(1)

pub fn bit_length(n: u64) -> u8 {
    (0u64.leading_zeros() - n.leading_zeros()) as u8
}

#[cfg(test)]

mod tests {

    #[test]

    fn test() {}
}