ABSTRACT

The java.lang library provides two classes that allow the implementation of high-precision arithmetic. The BigDecimal class supports arbitrary-precision operations on signed decimal numbers, while the BigInteger does the same for integers. These classes allow the programmer to define the precision of decimal and integer values. The resulting numbers are never changed by the system and never overflow. On the other hand, the mathematical operations that can be applied to arbitrary-precision data is limited to basic arithmetic, conversions, comparisons, and rounding. The java libraries provide no trigonometry, logarithms, or exponential functions for arbitrary-precision data.