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 1. Floating-Point Numbers Are Not Real!

When the designers of the early programming languages FORTRAN and ALGOL named one of their numeric data types REAL, was it simply for convenience, or were they being optimistic?

Just how close is Java's float type to the real number system of mathematics? Or, for that matter, what about the int type and the mathematical set of integers (the whole numbers)? We know there are gremlins such as overflows and roundoff errors, but there may be more nasty stuff lurking. What other pitfalls are out there?

Roundoff Errors

Consider the common fractions Roundoff Errors, , , , , and . In the decimal, or base 10, number system, ...

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