<float.h> - Characteristics
of floating types
This library supplies machine-dependent macros that define
the range and accuracy of floating-point types.
jump to: example of float.h
DBL_DIG |
15 |
number of decimal digits of precision |
DBL_MANT_DIG |
53 |
number of bits in mantissa |
DBL_MAX_10_EXP |
308 |
maximum decimal exponent |
DBL_MAX_EXP |
1024 |
maximum binary exponent |
DBL_MIN_10_EXP |
-307 |
maximal decimal exponent |
DBL_MIN_EXP |
-1024 |
minimum binary exponent |
DBL_RADIX |
2 |
exponent radix |
DBL_ROUNDS |
1 |
addition rounding |
DBL_EPSILON |
2.2204460942503131E-016 |
1.0+DBL_EPSILON != 1.0 |
DBL_MAX |
1.7976931348623151E+308 |
maximum value |
DBL_MIN |
2.2250738585072014E-308 |
minimum positive value |
FLT_DIG |
6 |
number of decimal digits ofprecision |
FLT_GUARD |
0 |
|
FLT_MANT_DIG |
24 |
number of bits in mantissa |
FLT_MAX_10_EXP |
38 |
maximum decimal exponent |
FLT_MAX_EXP |
128 |
maximum binary exponent |
FLT_MIN_10_EXP |
-37 |
minimum decimal exponent |
FLT_MIN_EXP |
-125 |
minimum binary exponent |
FLT_NORMALIZE |
0 |
|
FLT_RADIX |
2 |
eponent radix |
FLT_ROUNDS |
1 |
addition rounding chops |
FLT_EPSILON |
1.192092896E-07 |
smallest such that 1.0 +FLT_EPSILON != 1.0 |
FLT_MAX |
3.402823466E+38 |
maximum value |
FLT_MIN |
1.175493451E-38 |
minimum positive value |
|
|
|
LBDL_DIG |
19 |
number of decimal digits of precision |
LBDL_EPSILON |
5.4210108624275221706E-20 |
|
|
|
|
LBDL_MANT_DIG |
64 |
number of bits in mantissa |
LBDL_MAX |
1.189731495357231765E+492L |
maximum value |
LBDL_MAX_10_EXP |
4932 |
maximum decimal exponent |
LBDL_MAX_EXP |
16384 |
maximum binary exponent |
LBDL_MIN |
3.3621031431120935063E-4932L |
minimum positive value |
LBDL_MIN_10 |
(-4931) |
minimum decimal exponent |
LBDL_EXP |
(-16381) |
minimumum binary exponent |
LBDL_RADIX |
2 |
exponent radix |
LBDL_ROUNDS |
DBL_ROUNDS |
addition rounding |
|
|
|
Example:
This example will print the maximum value of float and
the minimum value of float. These values can be used for
reference or for practice as they are stored in this header
(along with others as in table).
#include <stdio.h>
#include <float.h>
int main(void)
{
printf("The maximum value
of float can be %.20e\n", FLT_MAX);
printf("The minimum value
of float can be %.20e\n", FLT_MIN);
return 0;
}
Note the .20 after the % character. This tells the compiler
to print 20 decimal places. Why 20? - it is just a large
obscure number. When you notice 00000 in the value on the
screen you know it's maximum precision because when precision
stops, values of 0 are printed to compensate the missing
of the 20 decimal places required as specified.
go to <limits.h> back
to top back
to main