round_up_to_power2

Function round_up_to_power2 

Source
pub fn round_up_to_power2(n: u32) -> (u32, u32)
Expand description

Given a 32-bit number, return the next highest power of 2, and the corresponding shift.

For example:

   if n is 7, then function will return (8, 3), which 8 = 1 << 3