Click or drag to resize

EuclidCeilingToPowerOfTwo(Int32) Method

Find the closest perfect power of two that is larger or equal to the provided 32 bit integer.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static int CeilingToPowerOfTwo(
	this int number
)

Parameters

number  Int32
The number of which to find the closest upper power of two.

Return Value

Int32
A power of two.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Int32. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentOutOfRangeException
See Also