SpecFunc_NextPowerOfTwo

SpecFunc_NextPowerOfTwo(n)

Smallest power of two greater or equal to the given n.

NextPowerOfTwo(n) = 2^{\lceil \log_2(n)\rceil}

Parameters:n : positive int
Returns:result : positive int

Examples

>>> import openturns as ot
>>> int(ot.SpecFunc.NextPowerOfTwo(42))
64