cfloat (float.h)


header

Characteristics of floating-point types

This header describes the characteristics of floating types for the specific system and compiler implemetation used.

A floating-point number is composed of four elements:
  • a sign: either negative or non-negative
  • a base (or radix): which expresses the amount of quantities that can be represented with a single digit (2 for binary, 10 for decimal, 16 for hexadecimal, and so on...)
  • a significand (or mantissa): which is a series of digits of the abovementioned base. The number of digits in this series is what is known as precision.
  • an exponent (also knon as characteristic, or scale): which represents the offset of the significand, which affects the value in the following way:
    value of floating-point = significand x baseexponent, with its corresponding sign.


The following panel shows the name of the different values defined in this header and their minimal magnitudes (positive numbers may be greater in value, and negative number may be less in value). Any particular implementation may have characteristics with greater magnitudes than those shown here:

*Except for FLT_RADIX, names beginning with FLT apply to the float type, those with DBL to double and those with LDBL to long double.

namemin.stands forexpresses
FLT_RADIX2RADIXBase for all floating-point types (float, double and long double).
FLT_MANT_DIG DBL_MANT_DIG LDBL_MANT_DIG MANTissa DIGitsPrecission of significand, i.e. the number of digits that conform the significand.
FLT_DIG DBL_DIG LDBL_DIG6
10
10
DIGitsNumber of decimal digits that can be rounded into a floating-point and back without change in the number of decimal digits.
FLT_MIN_EXP DBL_MIN_EXP LDBL_MIN_EXP MINimum EXPonentMinimum negative integer value for the exponent that generates a normalized floating-point number.
FLT_MIN_10_EXP DBL_MIN_10_EXP LDBL_MIN_10_EXP-37 -37 -37MINimum base-10 EXPonentMinimum negative integer value for the exponent of a base-10 expression that would generate a normalized floating-point number.
FLT_MAX_EXP DBL_MAX_EXP LDBL_MAX_EXP MAXimum EXPonentMaximum integer value for the exponent that generates a normalized floating-point number.
FLT_MAX_10_EXP DBL_MAX_10_EXP LDBL_MAX_10_EXP37 37 37MAXimum base-10 EXPonentMaximum integer value for the exponent of a base-10 expression that would generate a normalized floating-point number.
FLT_MAX DBL_MAX LDBL_MAX1E+37 1E+37 1E+37MAXimumMaximum finite representable floating-point number.
FLT_EPSILON DBL_EPSILON LDBL_EPSILON1E-5 1E-9 1E-9EPSILONDifference between 1 and the least value greater than 1 that is representable.
FLT_MIN DBL_MIN LDBL_MIN1E-37 1E-37 1E-37MINimumMinimum representable floating-point number.


See also