Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 正数的二进制表示属于常规化:128 1000 0000
- 负数的二进制表示属于补码+1:-128 11111111 11111111 11111111 10000000, 同理把一个负数的二进制转换成十进制也是补码+1
- << 带符号左移动 >>> 带符号右移动:128 >> 2 = 32(0010 0000), -128 >> 2 = -32, 正数移动空位补0,负数移动空位补1
- <<< 无符号左移动 >>> 无符号右移动:128 >>> 2 = 32(0010 0000), -128 >>> 2 = 1073741792(00111111 11111111 11111111 11100000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement