float.h in C Language
The header file float.h defines various macros related to the floating-point types float, double, and long double, specifying their ranges and precision.
FLT_ROUNDS
This macro indicates the rounding direction used in floating-point addition. Its possible values are:- -1: Undetermined.
- 0: Round towards zero.
- 1: Round to the nearest integer.
- 2: Round towards positive infinity.
- 3: Round towards negative infinity.
FLT_RADIX
This macro represents the base of the exponent in scientific notation, which is generally 2.- Maximum Values of Floating-Point Types
FLT_MAXDBL_MAXLDBL_MAX
- Minimum Positive Values of Floating-Point Types
FLT_MINDBL_MINLDBL_MIN
- Smallest Difference Representable Between Two Floating-Point Values (Machine Precision)
FLT_EPSILONDBL_EPSILONLDBL_EPSILON
DECIMAL_DIG
This macro indicates the number of decimal digits that can be represented accurately.FLT_EVAL_METHOD
This macro specifies how floating-point expressions are evaluated regarding type conversion. Its possible values are:- -1: Undetermined.
- 0: Operations are performed in the current type.
- 1: Operations involving
floatanddoubleuse the range and precision ofdouble. - 2: All floating-point operations use the range and precision of
long double.
- Number of Bits in the Mantissa
FLT_MANT_DIGDBL_MANT_DIGLDBL_MANT_DIG
- Number of Decimal Digits in the Exponent
FLT_DIGDBL_DIGLDBL_DIG
- Minimum Negative Exponent in Scientific Notation
FLT_MIN_EXPDBL_MIN_EXPLDBL_MIN_EXP
- Minimum Decimal Exponent in Scientific Notation (Negative)
FLT_MIN_10_EXPDBL_MIN_10_EXPLDBL_MIN_10_EXP
- Maximum Exponent in Scientific Notation
FLT_MAX_EXPDBL_MAX_EXPLDBL_MAX_EXP
- Maximum Decimal Exponent in Scientific Notation
FLT_MAX_10_EXPDBL_MAX_10_EXPLDBL_MAX_10_EXP
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.