0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = 1.0?
Why is it correct for 0.1f = 0.1d to be false?
IEEE 754 floating-point arithmetic is commonly used in processors and in programming languages, but often has surprising results. This talk will describe how floating-point arithmetic is a systematic approximation to real arithmetic, explain limitations to the approximation, and provide lessons to keep in mind for floating-point programming.
Particular examples will be drawn from C and Java.
Joe Darcy is a long-time developer in the JDK engineering group who as “Java Floating-Point Czar” has looked after Java numerics, amongst other responsibilities. Joe was involved with the design of Java’s strictfp floating-point semantics, added numerous floating-point math library methods to the platform, helped expand BigDecimal support, and added hexadecimal floating-point literals to the Java language and library. Joe was a participant in and interim editor for the IEEE 754r working group to revise the IEEE 754 floating-point standard.
©2015, O'Reilly Media, Inc. • (800) 889-8969 or (707) 827-7019 • Monday-Friday 7:30am-5pm PT • All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. • email@example.com