Skip to main content

next_power_of_two

Function next_power_of_two 

Source
pub fn next_power_of_two(value: usize) -> usize
Expand description

Round value up to the next power of two.

Returns value unchanged when it is already a power of two. Returns 1 when value is 0.