-1 - Unknown
0 - Round to 0
1 - Rounding to the nearest value
2 - Towards positive infinity
3 - Towards infinity negative FLT_RADIX 2 Definition represents the radix of the exponent. Base-2 is binary, base-10 is a decimal system .
FLT_MANT_DIG
DBL_MANT_DIG
LDBL_MANT_DIG
These macros define the number of digits to represent the real number (in FLT_RADIX base)FLT_DIG 6
DBL_DIG 10
LDBL_DIG 10
These macros determine the maximum number of decimal places (base-10) that can be represented without changing after rounding.FLT_MIN_EXP
DBL_MIN_EXP
LDBL_MIN_EXP
These macros determine the smallest vowel value for exponent in FLT_RADIX radixFLT_MIN_10_EXP -37
DBL_MIN_10_EXP -37
LDBL_MIN_10_EXP -37
These macros define the smallest vowel value for an exponent in base 10FLT_MAX_EXP
DBL_MAX_EXP
LDBL_MAX_EXP
These macros define the maximum integer value for an exponent in FLT_RADIX baseFLT_MAX_10_EXP +37
DBL_MAX_10_EXP +37
LDBL_MAX_10_EXP +37
These macros define the maximum integer value for an exponent in base 10FLT_MAX 1E + 37
DBL_MAX 1E + 37
LDBL_MAX 1E + 37
These macros determine the largest floating point real number valueFLT_EPSILON 1E-5
DBL_EPSILON 1E-9
LDBL_EPSILON 1E-9
These macros define the least significant digit that can be representedFLT_MIN 1E-37
DBL_MIN 1E-37
LDBL_MIN 1E-37
These macros define the smallest floating point real number valuesFor example
The following program C illustrates the usage of some constants defined in float.h.
#include #include int main () { printf ( "Gia tri max cua mot so thuc = %.10en" , FLT_MAX ); printf ( "Gia tri min cua mot so thuc = %.10en" , FLT_MIN ); printf ( "So ky so de bieu dien mot so = %.10en" , FLT_MANT_DIG ); }
Compiling and running the above C program will result:
According to Tutorialspoint
Previous article: errno.h in C
Next lesson: limits.h in C