D.3. Limits for integral numbers

Table D.3 gives the ranges for integral numbers in ARM C and C++. The third column of the table gives the numerical value of the range endpoint. The fourth column gives the bit pattern (in hexadecimal) that would be interpreted as this value by the ARM compilers.

When entering a constant, choose the size and sign with care. Constants are interpreted differently in decimal and hexadecimal/octal. See the appropriate C or C++ standard, or any of the recommended C and C++ textbooks for more details (see Further reading).

Table D.3. Integer ranges

ConstantMeaningEndpointHex value
CHAR_MAXMaximum value of char2550xFF
CHAR_MINMinimum value of char00x00
SCHAR_MAXMaximum value of signed char1270x7F
SCHAR_MINMinimum value of signed char–1280x80
UCHAR_MAXMaximum value of unsigned char2550xFF
SHRT_MAXMaximum value of short327670x7FFF
SHRT_MINMinimum value of short–327680x8000
USHRT_MAXMaximum value of unsigned short655350xFFFF
INT_MAXMaximum value of int21474836470x7FFFFFFF
INT_MINMinimum value of int–21474836480x80000000
LONG_MAXMaximum value of long21474836470x7FFFFFFF
LONG_MINMinimum value of long–21474836480x80000000
ULONG_MAXMaximum value of unsigned long42949672950xFFFFFFFF
LONG_LONG_MAXMaximum value of long long 9.2E+180x7FFFFFFF FFFFFFFF
LONG_LONG_MINMinimum value of long long–9.2E+180x80000000 00000000
ULONG_LONG_MAXMaximum value of unsigned long long1.8E+190xFFFFFFFF FFFFFFFF
Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential