When I run the following code under Windows7 x64, compiled with GCC of MinGW, the result seems to be underflowed:
cout<<-2147483648 ; //Output: 2147483648
but when I assigned it to a integer variable, or just simply convert it to the int type :
cout<<(int)-2147483648 ; //Output: -2147483648
So, what's wrong with the previous version of my code? Istn't it the type int? or what the lower bound the Integer is exactly?
Many thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…