2 ms·
Note that in the very next slide, the value 1.41667 is actually there, as the next tried value. (defun average (x y) (/ (+ x y) 2)) (defun itera
by junke 9y ago
Note that in the very next slide, the value 1.41667 is actually there, as the next tried value.
(defun average (x y)
(/ (+ x y) 2))
(defun iterate (start)
(loop repeat 3
for val = start then (average val (/ 2 val))
collect (list val (float val))))
(iterate 4/3)
((4/3 1.3333334) (17/12 1.4166666) (577/408 1.4142157))
(iterate 3/2)
((3/2 1.5) (17/12 1.4166666) (577/408 1.4142157))
Not sure if this is really a software bug, maybe a slide preparation bug.