Dfp is a radix 10000 floating point math library. It features compile-time defineable precision, usual arithmetic functions (add, subtract, multiply, divide, etc.), and a set of mathematical functions including: natural logarithm and exponential, trigonometic functions and their inverses.
Dfp also has IEEE-854 defined abilities such as user-specified rounding modes, user-defineable trap handlers, and status flaqs.
The following design goals were used to guide development of dfp.
rossi.dfp.dfpdec
fixes most of these these minor inconsitancies at the cost of
some performance.
While it cannot compete with the ease of use and performance of
double, dfp beats BigDecimal
in both these areas.
It offers familiar methods such as add(), subtact(), multiply(),
and divide(). Each of these functions take only a single argument
which is the other dfp to be operated on. For example to divide
the dfp named dfpA by the dfp named dfpB ,
the following code snippet will do the job:
dfp result = dfpA.divide(dfpB);
There is no need to specify rounding modes or a scalar as with
BigDecimal. This simplifies usage considerably.