BitOperations.RotateLeft Method

Definition

Overloads

RotateLeft(UInt32, Int32)

Rotates the specified value left by the specified number of bits.

RotateLeft(UInt64, Int32)

Rotates the specified value left by the specified number of bits.

RotateLeft(UIntPtr, Int32)

Rotates the specified value left by the specified number of bits. Similar in behavior to the x86 instruction ROL.

RotateLeft(UInt32, Int32)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Rotates the specified value left by the specified number of bits.

C#
[System.CLSCompliant(false)]
public static uint RotateLeft(uint value, int offset);

Parameters

value
UInt32

The value to rotate.

offset
Int32

The number of bits to rotate by. Any value outside the range [0..31] is treated as congruent mod 32.

Returns

The rotated value.

Attributes

Remarks

This method is similar in behavior to the x86 instruction ROL.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

RotateLeft(UInt64, Int32)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Rotates the specified value left by the specified number of bits.

C#
[System.CLSCompliant(false)]
public static ulong RotateLeft(ulong value, int offset);

Parameters

value
UInt64

The value to rotate.

offset
Int32

The number of bits to rotate by. Any value outside the range [0..63] is treated as congruent mod 64.

Returns

The rotated value.

Attributes

Remarks

This method is similar in behavior to the x86 instruction ROL.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

RotateLeft(UIntPtr, Int32)

Source:
BitOperations.cs
Source:
BitOperations.cs
Source:
BitOperations.cs

Important

This API is not CLS-compliant.

Rotates the specified value left by the specified number of bits. Similar in behavior to the x86 instruction ROL.

C#
[System.CLSCompliant(false)]
public static UIntPtr RotateLeft(UIntPtr value, int offset);

Parameters

value
UIntPtr

The value to rotate.

offset
Int32

The number of bits to rotate by. Any value outside the range [0..31] is treated as congruent mod 32 on a 32-bit process, and any value outside the range [0..63] is treated as congruent mod 64 on a 64-bit process.

Returns

UIntPtr

The rotated value.

Attributes

Applies to

.NET 9 and other versions
Product Versions
.NET 7, 8, 9