NBit Bit Manipulation Library

BitMathExtensions.ReverseBits(UInt32, Int32) Method

Masks and reverses the specified number of bits of a value.

[Visual Basic]
<Extension> _
Public Overloads Shared Sub ReverseBits( _
   ByVal value As UInt32, _
   ByVal bits As Integer _
)
[C#]
[Extension]
public static uint ReverseBits(
   this uint value,
   this int bits
);

Parameters

value
The value to reverse the bits of.
bits
The number of bits to reverse.

Return Value

The masked and reversed bits.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException bits must be between 0 and 32.

See Also

BitMathExtensions Class | NBit Namespace | BitMathExtensions.ReverseBits Overload List