O'Reilly logo

Java™ Number Cruncher: The Java Programmer's Guide to Numerical Computing by Ronald Mak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Big Numbers

In the first three chapters of this book, we looked at the limitations of both integers and floating-point numbers. Of course, one major limitation is their precision—the long integer type has 19 digits, and the double floating-point type has about 17 significant digits. We also saw how the Java floating-point types only implement the default round to nearest rounding mode of the IEEE 754 floating-point standard.

Besides the primitive numeric types, Java implements big number, or arbitrary-precision, data types—the BigInteger and BigDecimal classes in the java.math package. These classes represent numbers that have arbitrary numbers of digits of precision, and they have methods to perform the common arithmetic operations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required