C# Feature - Unsigned right shift
Overview
Section titled βOverviewβThe unsigned right shift operator >>> shifts bits right and fills the left side with zeros, even for signed operands.
Introduced In
Section titled βIntroduced InβC# 11.0 (2022)
int shifted = (int)((uint)value >> 2);int shifted = value >>> 2;Gotchas & Best Practices
Section titled βGotchas & Best Practicesβ- Use
>>>when bit-level behavior matters more than arithmetic sign preservation. - Prefer ordinary
>>for arithmetic right shifts.