Decreasing size of data
For unsigned numbers:
All the bits being removed must be 0 !
For signed numbers:
Bits being removed must be all 1's or 0's and the first bit not being removed must have the same value as the removed ones.
Increasing size of data
For unsigned numbers:
All the new bits of the expanded number should be 0 !
For unsigned numbers:
The new bits must be copies of the sign bit.
博客介绍了数据大小调整的规则。对于无符号数,减小数据大小时移除的位必须为 0,增大时扩展的新位应为 0;对于有符号数,减小数据大小时移除的位须全为 1 或 0 且未移除的首位与移除位值相同,增大时新位是符号位的副本。
7440

被折叠的 条评论
为什么被折叠?



