- Source: src/math/pow2/index.js (Line 7)
Methods
-
<static> GetNext(value)
-
Returns the nearest power of 2 to the given
value
.Parameters:
Name Type Description value
number The value.
- Since: 3.0.0
- Source: src/math/pow2/GetPowerOfTwo.js (Line 7)
Returns:
The nearest power of 2 to
value
.- Type
- number
-
<static> IsSize(width, height)
-
Checks if the given
width
andheight
are a power of two. Useful for checking texture dimensions.Parameters:
Name Type Description width
number The width.
height
number The height.
- Since: 3.0.0
- Source: src/math/pow2/IsSizePowerOfTwo.js (Line 7)
Returns:
true
ifwidth
andheight
are a power of two, otherwisefalse
.- Type
- boolean
-
<static> IsValue(value)
-
Tests the value and returns
true
if it is a power of two.Parameters:
Name Type Description value
number The value to check if it's a power of two.
- Since: 3.0.0
- Source: src/math/pow2/IsValuePowerOfTwo.js (Line 7)
Returns:
Returns
true
ifvalue
is a power of two, otherwisefalse
.- Type
- boolean