2 ms·
At 1:05:20 one can see a bug where (average 1.5 (/ 2 1.5)) evaluates to 1.3333 rather than 1.4166 Nitpicking aside, I would have loved to have this sorcerer am
by tromp 9y ago
At 1:05:20 one can see a bug where
(average 1.5 (/ 2 1.5)) evaluates to 1.3333
rather than 1.4166
Nitpicking aside, I would have loved to have this sorcerer among my CS professors!
- junke 9y agoNote 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.