Provide utilities dealing with floating point decimal objects.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide utilities dealing with floating point decimal objects.
-
- Classes:
-
-
- Macros:
FP_SUBNORMAL | subnormal floating-point classification identifier constant |
FP_NORMAL | normal floating-point classification identifier constant |
FP_ZERO | zero floating-point classification identifier constant |
FP_INFINITE | infinity floating-point classification identifier constant |
FP_NAN | NaN floating-point classification identifier constant |
- Note that these macros may not be defined in this header. They are C99 standard macros and this component defines them only for those platforms that have failed to implement C99 (such as Microsoft).
- See also:
- Component bdldfp_decimal, Component bdldfp_decimalplatform
-
- Description:
- The
bdldfp::DecimalUtil
component provides utility functions for the decimal floating-point types defined in bdldfp_decimal
:
-
FP_XXX
, C99 standard floating-point classification macros
-
the
makeDecimal
functions building a decimal floating-point value out of a coefficient and exponent.
-
the
parseDecimal
functions that convert text to decimal value.
-
fma
, fabs
, ceil
, floor
, trunc
, round
- math functions
-
classify
and the isXxxx
floating-point value classification functions
- The
FP_XXX
C99 floating-point classification macros may also be provided by this header for platforms where C99 support is still not provided.
-
- Usage:
- This section shows the intended use of this component.
-
- Example 1: Building Decimals From Integer Parts:
- Floating-point numbers are built from a sign, a significand and an exponent. All those 3 are integers (of various sizes), therefore it is possible to build decimals from integers: