Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

>>>=: practical reference

>>>=: practical reference: >>>= performs a logical right shift and assigns the result.

Version: C# operator reference; verified against C# 14

Syntax

left >>>= right

= performs a logical right shift and assigns the result.

Use it to iteratively decode signed bits as unsigned.

It is not atomic and silently loses bits shifted out.

The shift count is masked and the result converts to the left-side type.

The complete program actually uses >>>=; its exact expected stdout is 2147483644.

Examples

using System;
using System.Linq;
using System.Threading.Tasks;

var value = -8; value >>>= 1; Console.WriteLine(value);

Result

2147483644

The complete program actually uses `>>>=`; its exact expected stdout is `2147483644`.

Sources