Questions tagged «numeric-limits»

6
为什么0 <-0x80000000?
我下面有一个简单的程序: #include &lt;stdio.h&gt; #define INT32_MIN (-0x80000000) int main(void) { long long bal = 0; if(bal &lt; INT32_MIN ) { printf("Failed!!!"); } else { printf("Success!!!"); } return 0; } 条件if(bal &lt; INT32_MIN )始终为真。这怎么可能? 如果我将宏更改为: #define INT32_MIN (-2147483648L) 谁能指出这个问题?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.