left shift : Bitwise Shift « Data Type « C# / CSharp Tutorial






class MainClass
{

  public static void Main()
  {

    byte byte1 = 0x9a;  // binary 10011010, decimal 154
    byte byte2 = 0xdb;  // binary 11011011, decimal 219
    byte result;

    System.Console.WriteLine("byte1 = " + byte1);
    System.Console.WriteLine("byte2 = " + byte2);

    
    result = (byte) (byte1 << 1);
    System.Console.WriteLine("byte1 << 1 = " + result);
  }

}
byte1 = 154
byte2 = 219
byte1 << 1 = 52








2.46.Bitwise Shift
2.46.1.The shift << operators
2.46.2.>> operators
2.46.3.Use the shift operators to multiply and divide by 2
2.46.4.left shift
2.46.5.right shift