You copied the Doc URL to your clipboard.

Limits for floating-point numbers

This topic describes the characteristics of floating-point numbers.

Table 41 gives the limits for floating-point numbers. These constants are defined in the float.h include file.

Table 41. Floating-point limits
ConstantMeaningValue
FLT_MAXMaximum value of float3.40282347e+38F
FLT_MINMinimum normalized positive floating-point number value of float1.175494351e-38F
DBL_MAXMaximum value of double1.79769313486231571e+308
DBL_MINMinimum normalized positive floating-point number value of double2.22507385850720138e-308
LDBL_MAXMaximum value of long double1.79769313486231571e+308
LDBL_MINMinimum normalized positive floating-point number value of long double2.22507385850720138e-308
FLT_MAX_EXPMaximum value of base 2 exponent for type float128
FLT_MIN_EXPMinimum value of base 2 exponent for type float-125
DBL_MAX_EXPMaximum value of base 2 exponent for type double1 024
DBL_MIN_EXPMinimum value of base 2 exponent for type double-1 021
LDBL_MAX_EXPMaximum value of base 2 exponent for type long double1 024
LDBL_MIN_EXPMinimum value of base 2 exponent for type long double-1 021
FLT_MAX_10_EXPMaximum value of base 10 exponent for type float38
FLT_MIN_10_EXPMinimum value of base 10 exponent for type float-37
DBL_MAX_10_EXPMaximum value of base 10 exponent for type double308
DBL_MIN_10_EXPMinimum value of base 10 exponent for type double-307
LDBL_MAX_10_EXPMaximum value of base 10 exponent for type long double308
LDBL_MIN_10_EXPMinimum value of base 10 exponent for type long double-307

Table 42 describes other characteristics of floating-point numbers. These constants are also defined in the float.h include file.

Table 42. Other floating-point characteristics
ConstantMeaningValue
FLT_RADIXBase (radix) of the ARM floating-point number representation2
FLT_ROUNDSRounding mode for floating-point numbers(nearest) 1
FLT_DIGDecimal digits of precision for float6
DBL_DIGDecimal digits of precision for double15
LDBL_DIGDecimal digits of precision for long double15
FLT_MANT_DIGBinary digits of precision for type float24
DBL_MANT_DIGBinary digits of precision for type double53
LDBL_MANT_DIGBinary digits of precision for type long double53
FLT_EPSILONSmallest positive value of x that 1.0 + x != 1.0 for type float1.19209290e-7F
DBL_EPSILONSmallest positive value of x that 1.0 + x != 1.0 for type double2.2204460492503131e-16
LDBL_EPSILONSmallest positive value of x that 1.0 + x != 1.0 for type long double2.2204460492503131e-16L

Note

  • When a floating-point number is converted to a shorter floating-point number, it is rounded to the nearest representable number.

  • Floating-point arithmetic conforms to IEEE 754.

Was this page helpful? Yes No