C99 标准以下列方式定义数据类型的范围:
— minimum value for an object of type signed char
SCHAR_MIN -127 // −(2^7 − 1)
— maximum value for an object of type signed char
SCHAR_MAX +127 // 2^7 − 1
— maximum value for an object of type unsigned char
UCHAR_MAX 255 // 2^8 − 1
— minimum value for an object of type char
CHAR_MIN see below
— maximum value for an object of type char
CHAR_MAX see below
— maximum number of bytes in a multibyte character, for any supported locale
MB_LEN_MAX 1
— minimum value for an object of type short int
SHRT_MIN -32767 // −(2^15 − 1)
— maximum value for an object of type short int
SHRT_MAX +32767 // 2^15 − 1
— maximum value for an object of type unsigned short int
USHRT_MAX 65535 // 2^16 − 1
— minimum value for an object of type int
INT_MIN -32767 // −(2^15 − 1)
— maximum value for an object of type int
INT_MAX +32767 // 2^15 − 1
— maximum value for an object of type unsigned int
UINT_MAX 65535 // 2^16 − 1
— minimum value for an object of type long int
LONG_MIN -2147483647 // −(2^31 − 1)
— maximum value for an object of type long int
LONG_MAX +2147483647 // 2^31 − 1
— maximum value for an object of type unsigned long int
ULONG_MAX 4294967295 // 2^32 − 1
如果我们看到负范围,它实际上可能比这里根据允许的二进制恭维表示定义的范围大一。为什么它们是这样定义的?