BDE 4.14.0 Production release
|
Provide utilities dealing with floating point decimal objects.
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).
The bdldfp::DecimalUtil
component provides utility functions for the decimal floating-point types defined in bdldfp_decimal :
FP_XXX
, C99 standard floating-point classification macrosmakeDecimal
functions building a decimal floating-point value out of a coefficient and exponent.parseDecimal
functions that convert text to decimal value.fma
, fabs
, ceil
, floor
, trunc
, round
- math functionsclassify
and the isXxxx
floating-point value classification functionsThe FP_XXX
C99 floating-point classification macros may also be provided by this header for platforms where C99 support is still not provided.
This section shows the intended use of this component.
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: