Table of Contents

npo2

num npo2(num x)

num - any numeric type (int or fixed)

Description

Returns x rounded up to the the Next Power Of 2. The input must be positive.

If x is a power of 2, x is unchanged.

Examples

npo2(16) -> 16
npo2(17) -> 32
npo2(6.5) -> 8.0
npo2(8.0) -> 8.0