MathExNextPowerOfTwo(Int32) Method |
Calculates the next highest power of two.
Namespace: NeoAxisAssembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.1.1.0 (2026.1.1.0)
Syntaxpublic static int NextPowerOfTwo(
int v
)
Parameters
- v Int32
- A value.
Return Value
Int32The next power of two after the value.
Remarks
This is a minimal method meant to be fast. There is a known edge case where an input of 0 will output 0
instead of the mathematically correct value of 1. It will not be fixed.
See Also