Limits on Floating-Point Constants

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Limits on Floating-Point Constants.

Microsoft Specific**

Limits on the values of floating-point constants are given in the following table. The header file FLOAT.H contains this information.

Limits on Floating-Point Constants

ConstantMeaningValue
FLT_DIGDBL_DIGLDBL_DIGNumber 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.6 15 15
FLT_EPSILONDBL_EPSILONLDBL_EPSILONSmallest positive number x, such that x + 1.0 is not equal to 1.01.192092896e–07F 2.2204460492503131e–016 2.2204460492503131e–016
FLT_GUARD0
FLT_MANT_DIGDBL_MANT_DIGLDBL_MANT_DIGNumber of digits in the radix specified by FLT_RADIX in the floating-point significand. The radix is 2; hence these values specify bits.24 53 53
FLT_MAXDBL_MAXLDBL_MAXMaximum representable floating-point number.3.402823466e+38F 1.7976931348623158e+308 1.7976931348623158e+308
FLT_MAX_10_EXPDBL_MAX_10_EXPLDBL_MAX_10_EXPMaximum integer such that 10 raised to that number is a representable floating-point number.38 308 308
FLT_MAX_EXPDBL_MAX_EXPLDBL_MAX_EXPMaximum integer such that FLT_RADIX raised to that number is a representable floating-point number.128 1024 1024
FLT_MINDBL_MINLDBL_MINMinimum positive value.1.175494351e–38F 2.2250738585072014e–308 2.2250738585072014e–308
FLT_MIN_10_EXPDBL_MIN_10_EXPLDBL_MIN_10_EXPMinimum negative integer such that 10 raised to that number is a representable floating-point number.–37

–307

–307
FLT_MIN_EXPDBL_MIN_EXPLDBL_MIN_EXPMinimum negative integer such that FLT_RADIX raised to that number is a representable floating-point number.–125

–1021

–1021
FLT_NORMALIZE0
FLT_RADIX_DBL_RADIX_LDBL_RADIXRadix of exponent representation.2 2 2
FLT_ROUNDS_DBL_ROUNDS_LDBL_ROUNDSRounding mode for floating-point addition.1 (near) 1 (near) 1 (near)

Note that the information in the above table may differ in future implementations.

END Microsoft Specific

C Floating-Point Constants

Show: