The <limits.h> Header File

Various platform-dependent constants proposed by ANSI

Constants

CHAR_BIT
Length of a char variable in bits.
CHAR_MAX
Maximal value which can be stored in a char variable.
CHAR_MIN
Minimal value which can be stored in a char variable.
INT_MAX
Maximal value which can be stored in an int variable.
INT_MIN
Minimal value which can be stored in an int variable.
LONG_MAX
Maximal value which can be stored in a long int variable.
LONG_MIN
Minimal value which can be stored in a long int variable.
SCHAR_MAX
Maximal value which can be stored in a signed char variable.
SCHAR_MIN
Minimal value which can be stored in a signed char variable.
SHRT_MAX
Maximal value which can be stored in a short int variable.
SHRT_MIN
Minimal value which can be stored in a short int variable.
UCHAR_MAX
Maximal value which can be stored in an unsigned char variable.
UINT_MAX
Maximal value which can be stored in an unsigned int variable.
ULONG_MAX
Maximal value which can be stored in an unsigned long int variable.
USHRT_MAX
Maximal value which can be stored in an unsigned short variable.

Note: CHAR_MAX and CHAR_MIN may have different values depending on whether chars are signed or not. They are signed by default in TIGCC, but this may be changed using a compiler command-line switch. Similarly, INT_MAX, INT_MIN, and UINT_MAX depend on whether short or long integers are used.

See also: values.h


CHAR_BIT

#define CHAR_BIT 8

Length of a char variable in bits.


CHAR_MAX

#define CHAR_MAX 127/255

Maximal value which can be stored in a char variable.


CHAR_MIN

#define CHAR_MIN (-128)/0

Minimal value which can be stored in a char variable.


INT_MAX

#define INT_MAX 0x7FFF/0x7FFFFFFF

Maximal value which can be stored in an int variable.


INT_MIN

#define INT_MIN ((int) 0x8000/0x80000000)

Minimal value which can be stored in an int variable.


LONG_MAX

#define LONG_MAX 0x7FFFFFFFL

Maximal value which can be stored in a long int variable.


LONG_MIN

#define LONG_MIN ((long) 0x80000000L)

Minimal value which can be stored in a long int variable.


SCHAR_MAX

#define SCHAR_MAX 127

Maximal value which can be stored in a signed char variable.


SCHAR_MIN

#define SCHAR_MIN (-128)

Minimal value which can be stored in a signed char variable.


SHRT_MAX

#define SHRT_MAX 0x7FFF

Maximal value which can be stored in a short int variable.


SHRT_MIN

#define SHRT_MIN ((short) 0x8000)

Minimal value which can be stored in a short int variable.


UCHAR_MAX

#define UCHAR_MAX 255

Maximal value which can be stored in an unsigned char variable.


UINT_MAX

#define UINT_MAX 0xFFFFU/0xFFFFFFFFUL

Maximal value which can be stored in an unsigned int variable.


ULONG_MAX

#define ULONG_MAX 0xFFFFFFFFUL

Maximal value which can be stored in an unsigned long int variable.


USHRT_MAX

#define USHRT_MAX 0xFFFFU

Maximal value which can be stored in an unsigned short variable.


Return to the main index