Java 的 左移 右移

版权声明:此文乃鄙人辛辛耕耘制作,饮其流者怀其源,请标明出处,跪谢!!! https://blog.csdn.net/CSDN_LJie/article/details/86682154

<< , >>, >>>

最大正数
+2e15-1 = 0x7fffffff
01111111111111111111111111111111 ;
11111111111111111111111111111110;// <<1 ,左移1 , 补零
00111111111111111111111111111111;// >>1 ,右移 1,负数补零
00111111111111111111111111111111; // >>>1 ,右移,补零

最小负数
-2e15 = -1 = 0xffffffff
11111111111111111111111111111111;
11111111111111111111111111111110; // <<1, 左移补零
11111111111111111111111111111111; // >>1, 右移,正数补一
01111111111111111111111111111111;// >>>1, 右移,补零

猜你喜欢

转载自blog.csdn.net/CSDN_LJie/article/details/86682154