From: Ramakrishnan Muthukrishnan Date: Thu, 27 May 2010 12:45:53 +0000 (+0530) Subject: solution to 1.40 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/about/frontends/CLI.txt?a=commitdiff_plain;h=e185c7f44e2a20c225fba1b4ced5bce70f5e9783;p=sicp.git solution to 1.40 --- diff --git a/src/sicp/ex1_40.clj b/src/sicp/ex1_40.clj new file mode 100644 index 0000000..741b646 --- /dev/null +++ b/src/sicp/ex1_40.clj @@ -0,0 +1,15 @@ +(ns sicp.ex1_40 + (:use [clojure.contrib test-is] + [sicp utils] + [sicp ch1_3])) + +(defn cubic [a b c] + (fn [x] (+ (cube x) + (* a (square x)) + (* b x) + c))) + +(comment +(newton-method (cubic 0 0 (* 3 3 -3)) 1.0) +;;=> 3.0000000000019176 +)