3 [clojure.contrib trace test-is]))
5 ;; Exercise 1.7: The good-enough? test used in computing square roots will not
6 ;; be very effective for finding the square roots of very small numbers. Also,
7 ;; in real computers, arithmetic operations are almost always performed with
8 ;; limited precision. This makes our test inadequate for very large numbers.
9 ;; Explain these statements, with examples showing how the test fails for small
12 user> (sqrt (square 0.001))
14 user> (sqrt (square 0.2))
16 user> (sqrt (square 0.01))
18 user> (sqrt (square 0.02))
20 user> (sqrt (square 10))
22 user> (sqrt (square 100))
24 user> (sqrt (square 200))
26 user> (sqrt (square 2))
28 user> (sqrt (square 0.1))
30 user> (sqrt (square 0.01))
32 user> (sqrt (square 10000))
34 user> (sqrt (square 20000))
36 user> (sqrt (square 200000))
38 user> (sqrt (square 20000000))
40 user> (sqrt (square 20000000000))
42 user> (sqrt (square 200000.012))
44 user> (sqrt (square 2000000.123))
46 user> (sqrt (square 200000000.123))
48 user> (sqrt (square 2000000000.123))
50 user> (sqrt (square 20000000000.123))
52 user> (sqrt (square 2000000000000.123))