Fractious Fractions: Arbitrary-Precision Arithmetic

Two times two is 3.9999999998, if you believe the results of some calculations using double values. Most Java developers have worked with the double and float data types. Perhaps you have also used some of the methods in the java.lang.Math class. This class is part of the Java core and includes methods for operations such as logarithms, exponents, and trigonometric functions. The precision of a double is sufficient for most needs, but for scientific and theoretical applications its 11-bit exponent and 52-bit mantissa (based on IEEE 754 double-precision floating point) can cause subtle errors ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.