Skip to content

Api > Mathf > NextPowerOfTwo()


Mathf.NextPowerOfTwo(number value)⚓︎

Returns the next power of two that is equal to, or greater than, the argument.

Parameters:⚓︎

Name Type Description
value number value

Returns:⚓︎

type Description
number the next power of two that is equal to, or greater than, the argument.

Usage⚓︎

---@type number
local value;


local val0 = Mathf:NextPowerOfTwo(value)