Click or drag to resize

BinaryMathNextPowerOfTwoGreaterOrEqualThan(UInt32) Method

Returns x if it is a power of two; otherwise, returns the smallest power of two that is greater than x.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntax
C#
public static uint NextPowerOfTwoGreaterOrEqualThan(
	uint x
)

Parameters

x  UInt32
The argument to test.

Return Value

UInt32
x if it is a power of two; otherwise, the smallest power of two that is greater than x.
Exceptions
ExceptionCondition
ArgumentOutOfRangeException Thrown when the result cannot be represented by a UInt32.
See Also