示例
// cs_operator_left_shift.cs
using System;
class Test
{
public static void Main()
{
int i = 1;
long lg = 1;
Console.WriteLine("0x{0:x}", i << 1);
Console.WriteLine("0x{0:x}", i << 33);
Console.WriteLine("0x{0:x}", lg << 33);
}
}
输出
0x2
0x2
0x200000000
请注意,i<<1 和 i<<33 给出相同的结果,因为 1 和 33 低序的 5 个位相同。