对浮点常量的限制Limits on Floating-Point Constants

Microsoft 专用Microsoft Specific

下表中提供了对浮点常量值的限制。Limits on the values of floating-point constants are given in the following table. 头文件 FLOAT.H 包含此信息。The header file FLOAT.H contains this information.

对浮点常量的限制Limits on Floating-Point Constants

常量Constant 含义Meaning Value
FLT_DIGFLT_DIG
DBL_DIGDBL_DIG
LDBL_DIGLDBL_DIG
位数 q,以便 q 十进制数的浮点数可以被舍入到浮点表示形式并返回,而不会丢失精度。Number of digits, q, such that a floating-point number with q decimal digits can be rounded into a floating-point representation and back without loss of precision. 66
1515
1515
FLT_EPSILONFLT_EPSILON
DBL_EPSILONDBL_EPSILON
LDBL_EPSILONLDBL_EPSILON
最小正数 x,以便 x + 1.0 不等于 1.0Smallest positive number x, such that x + 1.0 is not equal to 1.0 1.192092896e-07F1.192092896e-07F
2.2204460492503131e-0162.2204460492503131e-016
2.2204460492503131e-0162.2204460492503131e-016
FLT_GUARDFLT_GUARD 00
FLT_MANT_DIGFLT_MANT_DIG
DBL_MANT_DIGDBL_MANT_DIG
LDBL_MANT_DIGLDBL_MANT_DIG
由浮点有效位数中的 FLT_RADIX 指定的基数中的位数。Number of digits in the radix specified by FLT_RADIX in the floating-point significand. 基数为 2;因此这些值指定位。The radix is 2; hence these values specify bits. 2424
5353
5353
FLT_MAXFLT_MAX
DBL_MAXDBL_MAX
LDBL_MAXLDBL_MAX
可表示的最大浮点数。Maximum representable floating-point number. 3.402823466e+38F3.402823466e+38F
1.7976931348623158e+3081.7976931348623158e+308
1.7976931348623158e+3081.7976931348623158e+308
FLT_MAX_10_EXPFLT_MAX_10_EXP
DBL_MAX_10_EXPDBL_MAX_10_EXP
LDBL_MAX_10_EXPLDBL_MAX_10_EXP
最大整数,以便 10 的该数字的幂是一个可表示的浮点数。Maximum integer such that 10 raised to that number is a representable floating-point number. 3838
308308
308308
FLT_MAX_EXPFLT_MAX_EXP
DBL_MAX_EXPDBL_MAX_EXP
LDBL_MAX_EXPLDBL_MAX_EXP
最大整数,以便 FLT_RADIX 的该数字的幂是一个可表示的浮点数。Maximum integer such that FLT_RADIX raised to that number is a representable floating-point number. 128128
10241024
10241024
FLT_MINFLT_MIN
DBL_MINDBL_MIN
LDBL_MINLDBL_MIN
最小正值。Minimum positive value. 1.175494351e-38F1.175494351e-38F
2.2250738585072014e-3082.2250738585072014e-308
2.2250738585072014e-3082.2250738585072014e-308
FLT_MIN_10_EXPFLT_MIN_10_EXP
DBL_MIN_10_EXPDBL_MIN_10_EXP
LDBL_MIN_10_EXPLDBL_MIN_10_EXP
最小负整数,以便 10 的该数字的幂是一个可表示的浮点数。Minimum negative integer such that 10 raised to that number is a representable floating-point number. -37-37
-307-307
-307-307
FLT_MIN_EXPFLT_MIN_EXP
DBL_MIN_EXPDBL_MIN_EXP
LDBL_MIN_EXPLDBL_MIN_EXP
最小负整数,以便 FLT_RADIX 的该数字的幂是一个可表示的浮点数。Minimum negative integer such that FLT_RADIX raised to that number is a representable floating-point number. -125-125
-1021-1021
-1021-1021
FLT_NORMALIZEFLT_NORMALIZE 00
FLT_RADIXFLT_RADIX
_DBL_RADIX_DBL_RADIX
_LDBL_RADIX_LDBL_RADIX
基数的指数表示形式。Radix of exponent representation. 22
22
22
FLT_ROUNDSFLT_ROUNDS
_DBL_ROUNDS_DBL_ROUNDS
_LDBL_ROUNDS_LDBL_ROUNDS
浮点加法的舍入模式。Rounding mode for floating-point addition. 1(相邻)1 (near)
1(相邻)1 (near)
1(相邻)1 (near)

请注意,上表中的信息可能在未来的实现中不同。Note that the information in the above table may differ in future implementations.

结束 Microsoft 专用END Microsoft Specific

另请参阅See Also

C 浮点常量C Floating-Point Constants