The following line:
printf("%ld\n", ((long) 7 << 63) >> 63));
Outputs -1
I've checked and
sizeof(long) == 8
Why is this happening?
((long) 7 << 63) >> 63)
调用未定义的行为,因为(long) 7 << 63
在long
无法表示。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.