| MathHelperNextPowerOf2 Method |
Returns the smallest power of two that is greater than the given value.
Namespace: DigitalRune.MathematicsAssembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax [CLSCompliantAttribute(false)]
public static uint NextPowerOf2(
uint value
)
<CLSCompliantAttribute(false)>
Public Shared Function NextPowerOf2 (
value As UInteger
) As UInteger
public:
[CLSCompliantAttribute(false)]
static unsigned int NextPowerOf2(
unsigned int value
)
[<CLSCompliantAttribute(false)>]
static member NextPowerOf2 :
value : uint32 -> uint32
Parameters
- value
- Type: SystemUInt32
The value.
Return Value
Type:
UInt32
The smallest power of two (2
x) that is greater than
value.
Remarks
For example, NextPowerOf2(7) is 8 and NextPowerOf2(8) is 16.
See Also