1. C Dev Maximum 32 Bit Value Chart
  2. C Dev Maximum 32 Bit Value Calculator
< C Programming

limits.h includes definitions of the characteristics of common variable types. The values are implementation specific, but may not be of lower magnitude than certain specified values in a conforming C implementation.

The C99 standard also specifies the <stdint.h> header file, which provides names and limits for explicitly-sized platform-independent integer datatypes (e.g. int32_t for a 32-bit signed integer).

Two's complement implementations have SCHARMIN equal to −128 (and similarly for all other MIN values). 32-bit implementations will set INTMAX equal to +2,147,483,647 (and likewise for INTMIN and UINTMAX) Unicode-supporting implementations will set MBLENMAX to 4 or more. Many DSPs have CHARBIT equal to 16 or more.

Member constants[edit]

The 'minimum-magnitude value' column is the minimum possible magnitude for this constant as specified by the standard. In particular, _MIN values represent the minimum magnitude representable in the rarely-used one's complement and sign-magnitude forms. Most implementations will have larger magnitudes for at least some of these numbers. For instance: /afv-tom-bergeron-auto-tune.html.

  • Two's complement implementations have SCHAR_MIN equal to −128 (and similarly for all other _MIN values).
  • 32-bit implementations will set INT_MAX equal to +2,147,483,647 (and likewise for INT_MIN and UINT_MAX)
  • Unicode-supporting implementations will set MB_LEN_MAX to 4 or more.
  • Many DSPs have CHAR_BIT equal to 16 or more[1][2].
NameDescriptionTypical valueANSI standard minimum-
or maximum magnitude value
CHAR_BITNumber of bits in a char8≥+8
SCHAR_MINMinimum value for a signed char−128≤−127
SCHAR_MAXMaximum value for a signed char+127≥+127
UCHAR_MAXMaximum value for an unsigned char+255≥+255
CHAR_MINMinimum value for a char−128≤−127
(if char is represented as a
signed char; otherwise ≤0)
CHAR_MAXMaximum value for a char+127≥+127
(if char is represented as a
signed char; otherwise ≥+255)
MB_LEN_MAXMaximum multi byte length of a character across all localesvaries, usually at least 4≥+1
SHRT_MINMinimum value for a short int−32,768≤−32,767
SHRT_MAXMaximum value for a short int+32,767≥+32,767
USHRT_MAXMaximum value for an unsigned short int+65,535≥+65,535
INT_MINMinimum value for an int−2,147,483,648≤−32,767
INT_MAXMaximum value for an int+2,147,483,647≥+32,767
UINT_MAXMaximum value for an unsigned int+4,294,967,295≥+65,535
LONG_MINMinimum value for a long int32 bit compiler−2,147,483,648≤−2,147,483,647
64 bit compiler−9,223,372,036,854,775,808
LONG_MAXMaximum value for a long int32 bit compiler+2,147,483,647≥+2,147,483,647
64 bit compiler+9,223,372,036,854,775,807
ULONG_MAXMaximum value for an unsigned long int32 bit compiler+4,294,967,295≥+4,294,967,295
64 bit compiler+18,446,744,073,709,551,615
LLONG_MINMinimum value for a long long int−9,223,372,036,854,775,808≤−9,223,372,036,854,775,807
LLONG_MAXMaximum value for a long long int+9,223,372,036,854,775,807≥+9,223,372,036,854,775,807
ULLONG_MAXMaximum value for an unsigned long long int+18,446,744,073,709,551,615≥+18,446,744,073,709,551,615

References[edit]

  • C Guide--2.5 limits.h, accessed on September 2006.
32-bit ram

C Dev Maximum 32 Bit Value Chart

External links[edit]

C Dev Maximum 32 Bit Value Calculator

Retrieved from 'https://en.wikibooks.org/w/index.php?title=C_Programming/limits.h&oldid=3283671'