4FLOATING-POINT REPRESENTATION
Floating-point arithmetic is an approximation of real arithmetic that solves the major problem with integer data types—the inability to represent fractional values. However, the inaccuracies in this approximation can lead to serious defects in application software. In order to write great software that produces correct results when using floating-point arithmetic, programmers must be aware of the machine’s underlying numeric representation and exactly how floating-point arithmetic approximates real arithmetic.
4.1 Introduction to Floating-Point Arithmetic
There is an infinite number of possible real values. Floating-point ...
Get Write Great Code, Volume 1, 2nd Edition 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.