Returns the nearest (smaller or larger) power of 2 for the specified value.
The value for which to calculate the nearest power of 2.
The nearest power of 2.
pc.math.nearestPowerOfTwo(17); // returns 16pc.math.nearestPowerOfTwo(24); // returns 32 Copy
pc.math.nearestPowerOfTwo(17); // returns 16pc.math.nearestPowerOfTwo(24); // returns 32
Returns the nearest (smaller or larger) power of 2 for the specified value.