maad.util.shift_bit_length

maad.util.shift_bit_length(x)[source]

Find the closest power of 2 that is superior or equal to the number x.

Parameters:
xscalar
Returns:
yscalar

the closest power of 2 that is superior or equal to the number x

Examples

>>> maad.util.shift_bit_length(1000)
    1024