Part IV. The Joys of Computation

Numerical computation isn't all work and no play. The final part of this book covers its lighter side. However, “light” doesn't mean “frivolous”—there's useful material in these last chapters, too!

Chapter 12 covers Java's BigNumber and BigDecimal classes, which support “arbitrary precision” arithmetic—subject to memory constraints, we can have numbers with as many digits as we like. This chapter explores how these classes can be useful. We compute a large prime number with more than 3,000 digits, and we write functions that can compute values such as The Joys of Computation and ex to an arbitrary number of digits of precision.

Mathematicians ...

Get Java™ Number Cruncher: The Java Programmer's Guide to Numerical Computing 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.