Click or drag to resize

BinaryMathNextPowerOfTwoGreaterOrEqualThan(Int64) 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 long NextPowerOfTwoGreaterOrEqualThan(
	long x
)

Parameters

x  Int64
The argument to test.

Return Value

Int64
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 Int64.
See Also