]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex1_40.clj
Solutions to 4.27, 4.28 and 4.29.
[sicp.git] / src / sicp / ex1_40.clj
1 (ns sicp.ex1_40
2   (:use [clojure.contrib test-is]
3         [sicp utils]
4         [sicp ch1_3]))
5
6 (defn cubic [a b c]
7   (fn [x] (+ (cube x)
8              (* a (square x))
9              (* b x)
10              c)))
11
12 (comment
13 (newton-method (cubic 0 0 (* 3 3 -3)) 1.0)
14 ;;=> 3.0000000000019176
15 )