]> git.rkrishnan.org Git - sicp.git/commitdiff
modification to make-center-percentage to make use of make-center-width
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Mon, 14 Jun 2010 03:19:26 +0000 (08:49 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Mon, 14 Jun 2010 03:19:26 +0000 (08:49 +0530)
src/sicp/ex2_12.clj

index 9cf9019f61b25d8eb5ff3dbe7b58bd4d54edb52e..510cd994de84d4fd8c1833affe86b465531c981e 100644 (file)
@@ -3,9 +3,8 @@
        [clojure.test]))
 
 (defn make-center-percent [c p]
-  (let [u (+ c (* c p 0.01))
-       l (- c (* c p 0.01))]
-    (make-interval l u)))
+  (let [w (* c p 0.01)]
+    (make-center-width c w)))
 
 (defn percentage [i]
   (let [c (center i)