Integer.MAX_VALUE+1==Integer.MIN_VALUE

I nteger.MAX_VALUE为 2的31次方减一 2 147 483 647 ,Integer.MIN_VALUE为 负2的31次方为 2 147 483 648Integer.max_value = 01111111 111111111111111111111111+1 = 10000000 00000000 00000000 00000000最高位是符号位为1,这个数是负数,负数的源码是补码取反+1,刚好等于Integer.min_value

发布了75 篇原创文章 · 获赞 12 · 访问量 844

猜你喜欢

转载自blog.csdn.net/weixin_45706762/article/details/104901445
今日推荐