Click or drag to resize

BinaryMathNextPowerOfTwoGreaterOrEqualThan(Int32) 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 int NextPowerOfTwoGreaterOrEqualThan(
	int x
)

Parameters

x  Int32
The argument to test.

Return Value

Int32
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 an Int32.
See Also