Page 687 - AP Computer Science A, 7th edition
P. 687

25. (A) Since results of calculations with floating-point numbers are not always represented exactly (round-off error), direct tests for equality are not reliable. Instead of the boolean expression d == c, a test should be done to check whether the difference of d and c is within some acceptable tolerance interval (see the Box on comparing floating-point numbers, p. 65).


































































































   685   686   687   688   689