相変わらずSICPをelispで
(defun goodenough (guess x)(< (abs (- (* guess guess) x)) 0.001)) (defun improve (guess x) (average guess (/ x guess))) (defun average (x y) (/ (+ x y) 2)) (defun sqlt_it (guess x) (if (goodenough guess x) guess (sqlt_it (improve guess x) x))) (sqlt_it 1.0 5) 2.2360688956433634