C++2147483648

于stackoverflow上张了很多有关-2147483648的题材,因为这个数字在电脑中之变现实在与直观的认识不均等

比如:(-2147483648>
0) returns true in
C++?

-2147483648 is not a “number”. C++ language does not support negative
literal values.
-2147483648 is actually an expression: a positive literal value
2147483648 with unary -operator in front of it. Value 2147483648 is
apparently too large for the positive side of int range on your
platform. If type long int had greater range on your platform, the
compiler would have to automatically assume that 2147483648 has long
int type. (In C++11 the compiler would also have to consider long long
int type.) This would make the compiler to evaluate -2147483648 in the
domain of larger type and the result would be negative, as one would
expect.

注:2147483648=2^31,等于0x1000 0000 0000 0000
当者那种写法是未正确的,实际上
0x1000 0000 0000 0000=-2147483648,这是发出号数

翻译:
-2147483648当电脑中并无是一个严酷意义及之屡屡,c++不支持因的字面值。
-2147483648实则是一个表达式,是一个正2147483648丰富一个一样长操作符-,当然对int来说,2147483648最为怪了,int最可怜不得不表示到
2^31-1=2147483648-1=2147483647
故此编译器会默认的行使long int(在c++11被编译器也说不定应用long long
int)

当我为此vs2013试跳了一晃,直接编译都未克通过:

int main()
{
    if (-2147483648 > 0)
        std::cout << "true";
}

错误:
error C4146: unary minus operator applied to unsigned type, result still unsigned
vs直接告诉你,把同第一之标记加给一个无符号数,结果或者一个无符号数
故此当vs里面凡是管这个数成为无符号数了
但我碰了瞬间 long long
莫亮堂呢啥要报是摩擦?