Click or drag to resize

MathExNextPowerOfTwo Method (UInt32)

Calculates the next highest power of two.

Namespace:  NeoAxis
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public static uint NextPowerOfTwo(
	uint v
)

Parameters

v
Type: SystemUInt32
A value.

Return Value

Type: UInt32
The 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