nedcomp hosting homepage

Producten en Diensten
Dedicated servers
Datacenter informatie
Partners, resellers
Helpdesk informatie
Technische docs, tools
Support homepage
ASP componenten
Praktische ASP, ASP.NET
Visual route server
Whois (domein gegevens)
Software documentatie
Whitepapers
Zoeken
Nedcomp / algemeen

Zoeken
 

Copyright © Nedcomp Hosting
Telefoon nr :   +31 184 670111
Fax nummer :   +31 184 631384
E-mailadres :   info@nedcomp.nl
 

C# Programmer's Reference  

>> Operator

The right-shift operator (>>) shifts its first operand right by the number of bits specified by its second operand.

expr >> count

Where:

expr
An expression of type int, uint, long, or ulong; the value to be shifted.
count
An expression of type int; the shift count.

Remarks

If expr is an int or uint (32-bit quantity), the shift count is given by the low-order five bits of count (count & 0x1f).

If expr is a long or ulong (64-bit quantity), the shift count is given by the low-order six bits of count (count & 0x3f).

If expr is an int or long, the right-shift is an arithmetic shift (high-order empty bits are set to the sign bit). If expr is of type uint or ulong, the right-shift is a logical shift (high-order bits are zero-filled).

User-defined types can overload the >> operator (see operator); the type of the first operand must be the user-defined type, and the type of the second operand must be int.

Example

// cs_operator_right_shift.cs
using System;
class Test 
{
   public static void Main() 
   {
      int i = -1000;
      Console.WriteLine(i >> 3);
   }
}

Output

-125

See Also

C# Operators | 7.8 Shift operators | << Operator