| |||
| Home > ARM Compiler Reference > Limits for integral numbers | |||
The following table gives the ranges for integral numbers as implemented in ARM C and C++. The third column of the table gives the numerical value of the range endpoint. The right hand column gives the bit pattern (in hexadecimal) that would be interpreted as this value by the ARM compilers.
When entering constants, you must be careful about the size and sign of the quantity. Constants are interpreted differently in decimal and hexadecimal/octal. See the appropriate C or C++ standard, or any of the recommended textbooks on the C and C++ programming language for more details.
Table 3.12. Integer ranges
| Constant | Meaning | End-point | Hex Value |
|---|---|---|---|
CHAR_MAX | Maximum value of char | 255 | 0xff |
CHAR_MIN | Minimum value of char | 0 | 0x00 |
SCHAR_MAX | Maximum value of signed char | 127 | 0x7f |
SCHAR_MIN | Minimum value of signed char | –128 | 0x80 |
UCHAR_MAX | Maximum value of unsigned char | 255 | 0xff |
SHRT_MAX | Maximum value of short | 32767 | 0x7fff |
SHRT_MIN | Minimum value of short | –32768 | 0x8000 |
USHRT_MAX | Maximum value of unsigned short | 65535 | 0xffff |
INT_MAX | Maximum value of int | 2147483647 | 0x7fffffff |
INT_MIN | Minimum value of int | –2147483648 | 0x80000000 |
LONG_MAX | Maximum value of long | 2147483647 | 0x7fffffff |
LONG_MIN | Minimum value of long | –2147483648 | 0x80000000 |
ULONG_MAX | Maximum value of unsigned long | 4294967295 | 0xffffffff |