The Shift Operators : Shift operator : Operator C# Examples


C# Examples » Operator » Shift operator »

 

The Shift Operators








>>: Right shift

The general forms for these operators are shown here:




    
value  <  num-bits  
value  >  num-bits
    
   
  
   


A 'left shift' shift all bits to the left and a zero bit to be brought in on the right.
A 'right shift' causes all bits to be shifted right one position.
In the case of a right shift on an unsigned value, a zero is brought in on the left.
In the case of a right shift on a signed value, the sign bit is preserved.




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Operator
» Shift operator