From: Ramakrishnan Muthukrishnan Date: Mon, 14 Jun 2010 03:19:26 +0000 (+0530) Subject: modification to make-center-percentage to make use of make-center-width X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/rgr-080307.php?a=commitdiff_plain;h=94c38bb38aa65cb6e03a815b86940cb2dc544aeb;p=sicp.git modification to make-center-percentage to make use of make-center-width --- diff --git a/src/sicp/ex2_12.clj b/src/sicp/ex2_12.clj index 9cf9019..510cd99 100644 --- a/src/sicp/ex2_12.clj +++ b/src/sicp/ex2_12.clj @@ -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)