预计阅读本页时间:-
B.11 Implementation-defined Limits: <limits.h> and <float.h>
The header <limits.h> defines constants for the sizes of integral types. The values below are acceptable minimum magnitudes; larger values may be used.
广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元
CHAR_BIT 8bits in a char
CHAR_MAX UCHAR_MAX or SCHAR_MAX maximum value of char
CHAR_MIN 0 or SCHAR_MINmaximum value of char
INT_MAX 32767maximum value of int
INT_MIN -32767minimum value of int
LONG_MAX 2147483647maximum value of long
LONG_MIN -2147483647minimum value of long
SCHAR_MAX+127maximum value of signed char
SCHAR_MIN-127minimum value of signed char
SHRT_MAX +32767maximum value of short
SHRT_MIN -32767minimum value of short
UCHAR_MAX255maximum value of unsigned char
UINT_MAX 65535maximum value of unsigned int
ULONG_MAX4294967295maximum value of unsigned long
USHRT_MAX65535maximum value of unsigned short
The names in the table below, a subset of <float.h>, are constants related to floating-point arithmetic. When a value is given, it represents the minimum magnitude for the corresponding quantity. Each implementation defines appropriate values.
FLT_RADIX 2radix of exponent, representation, e.g., 2, 16
FLT_ROUNDS floating-point rounding mode for addition
FLT_DIG 6decimal digits of precision
FLT_EPSILON 1E-5smallest number x such that 1.0+x != 1.0
FLT_MANT_DIG number of base FLT_RADIX in mantissa
FLT_MAX 1E+37 maximum floating-point number
FLT_MAX_EXP maximum n such that FLT_RADIXn-1 is representable
FLT_MIN 1E-37minimum normalized floating-point number
FLT_MIN_EXP minimum n such that 10n is a normalized number
DBL_DIG 10decimal digits of precision
DBL_EPSILON 1E-9smallest number x such that 1.0+x != 1.0
DBL_MANT_DIGnumber of base FLT_RADIX in mantissa
DBL_MAX 1E+37maximum double floating-point number
DBL_MAX_EXP maximum n such that FLT_RADIXn-1 is representable
DBL_MIN 1E-37minimum normalized double floating-point number
DBL_MIN_EXP minimum n such that 10n is a normalized number
Back to Appendix A -- Index -- Appendix C