Data Type Constants


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Data Type Constants.

Data type constants are implementation-dependent ranges of values allowed for integral data types. The constants listed below give the ranges for the integral data types and are defined in LIMITS.H.

System_CAPS_ICON_note.jpg Note

The /J compiler option changes the default char type to unsigned.

SCHAR_MAX127Maximum signed char value
SCHAR_MIN–128Minimum signed char value
UCHAR_MAX255 (0xff)Maximum unsigned char value
CHAR_BIT8Number of bits in a char
USHRT_MAX65535 (0xffff)Maximum unsigned short value
SHRT_MAX32767Maximum (signed) short value
SHRT_MIN–32768Minimum (signed) short value
UINT_MAX4294967295 (0xffffffff)Maximum unsigned int value
ULONG_MAX4294967295 (0xffffffff)Maximum unsigned long value
INT_MAX2147483647Maximum (signed) int value
INT_MIN–2147483647–1Minimum (signed) int value
LONG_MAX2147483647Maximum (signed) long value
LONG_MIN–2147483647–1Minimum (signed) long value
CHAR_MAX127 (255 if /J option used)Maximum char value
CHAR_MIN–128 (0 if /J option used)Minimum char value
MB_LEN_MAX2Maximum number of bytes in multibyte char
_I64_MAX9223372036854775807Maximum (signed) __int64 value
_I64_MIN-9223372036854775807-1Minimum (signed) __int64 value
_UI64_MAX0xffffffffffffffffMaximum (unsigned) __int64 value

The following constants give the range and other characteristics of the double and float data types, and are defined in FLOAT.H:

DBL_DIG15# of decimal digits of precision
DBL_EPSILON2.2204460492503131e-016Smallest such that 1.0+DBL_EPSILON !=1.0
DBL_MANT_DIG53# of bits in mantissa
DBL_MAX1.7976931348623158e+308Maximum value
DBL_MAX_10_EXP308Maximum decimal exponent
DBL_MAX_EXP1024Maximum binary exponent
DBL_MIN2.2250738585072014e-308Minimum positive value
DBL_MIN_10_EXP(-307)Minimum decimal exponent
DBL_MIN_EXP(–1021)Minimum binary exponent
_DBL_RADIX2Exponent radix
_DBL_ROUNDS1Addition rounding: near
FLT_DIG6Number of decimal digits of precision
FLT_EPSILON1.192092896e-07FSmallest such that 1.0+FLT_EPSILON !=1.0
FLT_MANT_DIG24Number of bits in mantissa
FLT_MAX3.402823466e+38FMaximum value
FLT_MAX_10_EXP38Maximum decimal exponent
FLT_MAX_EXP128Maximum binary exponent
FLT_MIN1.175494351e-38FMinimum positive value
FLT_MIN_10_EXP(–37)Minimum decimal exponent
FLT_MIN_EXP(–125)Minimum binary exponent
FLT_RADIX2Exponent radix
FLT_ROUNDS1Addition rounding: near

Global Constants