TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
>>> operator is the unsigned right shift operator, introduced in C# 11. It shifts the bits of its left-hand operand to the right by the number of positions specified by its right-hand operand, always padding the high-order empty bit positions with zeros.
Unlike the standard right shift operator (>>), which performs an arithmetic shift on signed integer types (preserving the sign bit by padding with 1s for negative numbers), the >>> operator strictly performs a logical shift. It ignores the sign bit of the original value and unconditionally shifts zeros into the most significant bit (MSB) positions, regardless of whether the operand’s type is signed (int, long, sbyte, short) or unsigned (uint, ulong, byte, ushort).
Mechanical Behavior
1. Zero Padding When shifting a negative signed integer, the>>> operator forces a zero into the MSB, effectively changing the sign of the resulting value to positive. For unsigned types, >>> and >> produce identical results.
count) to prevent shifting by more bits than the type contains:
- For 32-bit operands (
int,uint), the shift count is evaluated ascount & 0x1F(equivalent tocount % 32). - For 64-bit operands (
long,ulong), the shift count is evaluated ascount & 0x3F(equivalent tocount % 64).
sbyte, byte, short, ushort), C# implicitly promotes it to an int before performing the shift operation. The result of the >>> operation will therefore be an int.
Compound Assignment
The operator supports compound assignment via>>>=. This evaluates the shift and assigns the result back to the left-hand variable in a single operation.
Master C# with Deep Grasping Methodology!Learn More





