The C99 standard defines a range of data types as follows:
β minimum value for an object of type signed char
SCHAR_MIN -127
β maximum value for an object of type signed char
SCHAR_MAX +127
β maximum value for an object of type unsigned char
UCHAR_MAX 255
β 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
β maximum value for an object of type short int
SHRT_MAX +32767
β maximum value for an object of type unsigned short int
USHRT_MAX 65535
β minimum value for an object of type int
INT_MIN -32767
β maximum value for an object of type int
INT_MAX +32767
β maximum value for an object of type unsigned int
UINT_MAX 65535
β minimum value for an object of type long int
LONG_MIN -2147483647
β maximum value for an object of type long int
LONG_MAX +2147483647
β maximum value for an object of type unsigned long int
ULONG_MAX 4294967295
If we see a negative range, it could actually be more than what is defined here as two valid representations of a compliment. Why are they defined like this?
source
share