Method RoundUpToPowerOf2
- Namespace
- Zyl.VectorTraits.Numerics
- Assembly
- VectorTraits.dll
RoundUpToPowerOf2(uint)
Round the given integral value up to a power of 2.
[CLSCompliant(false)]
public static uint RoundUpToPowerOf2(uint value)
Parameters
value
uintThe value.
Returns
- uint
The smallest power of 2 which is greater than or equal to
value
. Ifvalue
is 0 or the result overflows, returns 0.
RoundUpToPowerOf2(ulong)
Round the given integral value up to a power of 2.
[CLSCompliant(false)]
public static ulong RoundUpToPowerOf2(ulong value)
Parameters
value
ulongThe value.
Returns
- ulong
The smallest power of 2 which is greater than or equal to
value
. Ifvalue
is 0 or the result overflows, returns 0.
RoundUpToPowerOf2(ExUInt128)
Round the given integral value up to a power of 2.
[CLSCompliant(false)]
public static ExUInt128 RoundUpToPowerOf2(ExUInt128 value)
Parameters
value
ExUInt128The value.
Returns
- ExUInt128
The smallest power of 2 which is greater than or equal to
value
. Ifvalue
is 0 or the result overflows, returns 0.
RoundUpToPowerOf2(UInt128)
Round the given integral value up to a power of 2.
[CLSCompliant(false)]
public static UInt128 RoundUpToPowerOf2(UInt128 value)
Parameters
value
UInt128The value.
Returns
- UInt128
The smallest power of 2 which is greater than or equal to
value
. Ifvalue
is 0 or the result overflows, returns 0.
RoundUpToPowerOf2(nuint)
Round the given integral value up to a power of 2.
[CLSCompliant(false)]
public static nuint RoundUpToPowerOf2(nuint value)
Parameters
value
nuintThe value.
Returns
- nuint
The smallest power of 2 which is greater than or equal to
value
. Ifvalue
is 0 or the result overflows, returns 0.