<Cfloat> (float. h), cfloatfloat. h
Header file:
<Cfloat> (float. h)
Floating Point Type
This header file describes Floating Point features for special systems and compiler implementations.
A floating point number contains four elements:
- A sign: positive or negative;
- A base: This indicates that different numbers can be represented by a single number (2 is binary), and 10 is decimal ), 16 is the hexadecimal (hexadecimal )...);
- A significand: This is a series of base numbers mentioned earlier. In this series, the number of digits is a well-known precision;
- An exponent: it represents the offset of a valid number and affects its value in the following way:
Floating point value = valid number x base index (and corresponding sign (sign ))(Image)
Macro constant
The following table shows the names of different variables defined in this header file and the minimum and maximum values of all implementations.
(The specific implementation value may be greater or smaller than this value. See the description ):
When a group of macro storage is prefixed with FLT _, DBL _, and LDBL _, the one starting with FLT _ applies to float,Which must start with DBL _ is applicable to doubleLong double;
Name |
Value |
Representative |
Indicates |
FLT_RADIX |
2 or larger |
Base (radix)
|
Base number of all floating point types |
FLT_MANT_DIG DBL_MANT_DIG LDBL_MANT_DIG |
|
Number of digits of the ending number (MANTissa DIGits) |
The precision of the valid number, which is consistent with the number of digits of the valid number. |
FLT_DIG DBL_DIG LDBL_DIG |
6 or larger 10 or larger 10 or larger |
Precision (DIGits) |
A number in decimal format can be converted to a floating point number without changing the integer number. |
FLT_MIN_EXP DBL_MIN_EXP LDBL_MIN_EXP |
|
Minimum Index |
Used to generate the smallest negative integer value of a standardized floating point index |
FLT_MIN_10_EXP DBL_MIN_10_EXP LDBL_MIN_10_EXP |
-37 or smaller -37 or smaller -37 or smaller |
Minimum 10-based index |
A decimal exponential expression used to generate a standard floating point number. The smallest negative integer |
FLT_MAX_EXP DBL_MAX_EXP LDBL_MAX_EXP |
|
Largest Index |
Used to generate the maximum integer of a standardized floating point index |
FLT_MAX_10_EXP DBL_MAX_10_EXP LDBL_MAX_10_EXP |
37 or larger 37 or larger 37 or larger |
Index with a maximum of 10 |
A decimal exponential expression used to generate a standard floating point number. The maximum integer |
FLT_MAX DBL_MAX LDBL_MAX |
1E+37 Or larger
1E+37 Or larger
1E+37 Or larger
|
Max. |
Indicates the maximum floating point number. |
FLT_EPSILON DBL_EPSILON LDBL_EPSILON |
1E-5 Or smaller
1E-9 Or smaller
1E-9 Or smaller
|
EPSILON :)
|
The difference between 1 and the minimum value is greater than 1. |
FLT_MIN DBL_MIN LDBL_MIN |
1E-37 Or smaller
1E-37 Or smaller
1E-37 Or smaller
|
Minimum |
Minimum floating point number |
FLT_ROUNDS |
|
Rounding Mode
|
Rounding behavior. Possible values: -1: Unknown 0: round to 0 1: Rounding 2: positive infinity 3: negative infinity * Applicable to All floating point types (float, double, and long double) |
FLT_EVAL_METHOD |
|
Assignment Method |
Attribute of the value assignment format. Possible values: -1: Unknown 0: The range and precision of the value assignment type 1: when assigning values, float and double are treated as double, Long double is treated as long double. 2: When a value is assigned, all values are treated as long double. Other negative values indicate the implementation-defined behavior. * Applicable to All floating point types |
DECIMAL_DIG |
|
Decimal precision |
You can convert a decimal number to a floating point number, And no precision is lost when it is converted to the same number as the original one. |
Versatility
FLT_EVAL_METHODAndDECIMAL_DIGIs defined in the library that complies with the C99 standard or only in the library that complies with the C11 Standard
See
<Climits> (limits. h) INTEGER SIZE
/*
First modification time: January 30, 2016 20:32:35
*/