lance_core::utils::bit

Function log_2_ceil

Source
pub fn log_2_ceil(val: u32) -> u32
Expand description

Returns the number of bits needed to represent the given number

Inspired by https://graphics.stanford.edu/~seander/bithacks.html