《深入理解计算机系统》笔记

1,截断

1 int x = 53191;
2 short sx = (short) x; // -12345
3 int y = sx;  // -12345,符号扩展,把高16位设置为1,从而生成 -12345 的32位补码表示。
所有博文均为原著,如若转载,请注明出处!
原文地址:https://www.cnblogs.com/zpcoding/p/10314959.html