Floating Limits

The limits (constant names, meanings, and values) for floating types are defined in the standard include file FLOAT.H. They are:

Table 2.7 Limits for Floating Types

Constant Meaning Value

FLT_DIG DBL_DIG LDBL_DIG 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. 7 15 19
FLT_EPSILON DBL_EPSILON LDBL_EPSILON Smallest positive number x, such that x <153> 1.0 + x 1.192092896e-07F 2.2204460492503131e-016 5.4210108624275221706e-020
FLT_MANT_DIG DBL_MANT_DIG LDBL_MANT_DIG Number of digits in the radix specified by FLT_RADIX in the floating-point significand. In Microsoft C/C++, the radix is 2; hence these values specify bits. 24 53 64
FLT_MAX DBL_MAX LDBL_MAX Maximum representable floating-point number. 3.402823466e+38F 1.7976931348623158e+308 1.189731495357231765e+4932L
FLT_MAX_10_EXP DBL_MAX_10_EXP LDBL_MAX_10_EXP Maximum integer such that 10 raised to that number is a representable floating-point number. 38 308 4932
FLT_MAX_EXP DBL_MAX_EXP LDBL_MAX_EXP Maximum integer such that FLT_RADIX raised to that number is a representable floating-point number. 128 1024 16384
FLT_MIN DBL_MIN LDBL_MIN Minimum positive normalized floating-point number. 1.175494351e-38F 2.2250738585072014e-308 3.3621031431120935063e-4932L

Table 2.7 (continued)

Constant Meaning Value

FLT_MIN_10_EXP DBL_MIN_10_EXP LDBL_MIN_10_EXP Minimum negative integer such that 10 raised to that number is a representable floating-point number. –37 –307 –4931
FLT_MIN_EXP DBL_MIN_EXP LDBL_MIN_EXP Minimum negative integer such that FLT_RADIX raised to that number is a representable floating-point number. –125 –1021 –16381
FLT_RADIX DBL_RADIX LDBL_RADIX Radix of exponent representation. 2 2 2
FLT_ROUNDS DBL_ROUNDS LDBL_ROUNDS Rounding mode for floating-point addition. 1 (near) 1 (near) 1 (near)