Skip to Main Content
Java 6 Illuminated: An Active Learning Approach, 2nd Edition
book

Java 6 Illuminated: An Active Learning Approach, 2nd Edition

by Julie Anderson, Herve J. Franceschi
February 2008
Intermediate to advanced content levelIntermediate to advanced
1288 pages
39h 39m
English
Jones & Bartlett Learning
Content preview from Java 6 Illuminated: An Active Learning Approach, 2nd Edition
Binary representation of
floating-point numbers is
discussed in Appendix E.
REFERENCE POINT
5.8 Comparing Floating-Point Numbers 239
5.8 Comparing Floating-Point Numbers
As we explain in Appendix E, floats and doubles are stored using IEEE 754
standard format, which can introduce minor rounding errors when arith-
metic is performed. That said, it is not advisable to simply rely on the
equality operators to compare floating-point numbers.
Lets take a look at Example 5.8, which computes 11 * .1 two ways. First, at
line 11, we assign .0 to a double variable, d1, and at lines 1222 we add .1 to
d1 eleven times. Then, at line 24, we declare a second double ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second Edition

JFC Swing Tutorial, The: A Guide to Constructing GUIs, Second Edition

Kathy Walrath, Mary Campione, Alison Huml, Sharon Zakhour
Java Illuminated, 4th Edition

Java Illuminated, 4th Edition

Julie Anderson, Hervé J. Franceschi

Publisher Resources

ISBN: 9780763749637