Table of Contents

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 uint

The value.

Returns

uint

The smallest power of 2 which is greater than or equal to value. If value 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 ulong

The value.

Returns

ulong

The smallest power of 2 which is greater than or equal to value. If value 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 ExUInt128

The value.

Returns

ExUInt128

The smallest power of 2 which is greater than or equal to value. If value 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 UInt128

The value.

Returns

UInt128

The smallest power of 2 which is greater than or equal to value. If value 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 nuint

The value.

Returns

nuint

The smallest power of 2 which is greater than or equal to value. If value is 0 or the result overflows, returns 0.