From c46df9da78de1baad9c32ac5318509446d55341c Mon Sep 17 00:00:00 2001 From: Mark Engelberg Date: Sat, 21 May 2011 02:56:20 -0700 Subject: Math: Fixed breakages caused by 1.3's change to primitive math --- modules/math/src/main/clojure/clojure/contrib/math.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/math/src/main/clojure/clojure/contrib/math.clj b/modules/math/src/main/clojure/clojure/contrib/math.clj index 47629139..807468cf 100644 --- a/modules/math/src/main/clojure/clojure/contrib/math.clj +++ b/modules/math/src/main/clojure/clojure/contrib/math.clj @@ -175,7 +175,7 @@ round always returns an integer. Rounds up for values exactly in between two in (throw (IllegalArgumentException. "lcm requires two integers"))) (cond (zero? a) 0 (zero? b) 0 - :else (abs (* b (quot a (gcd a b)))))) + :else (abs (*' b (quot a (gcd a b)))))) ; Length of integer in binary, used as helper function for sqrt. (defmulti ^{:private true} integer-length class) @@ -196,7 +196,7 @@ round always returns an integer. Rounds up for values exactly in between two in (let [n-len (integer-length n)] (loop [init-value (if (even? n-len) (expt 2 (quot n-len 2)) - (expt 2 (inc (quot n-len 2))))] + (expt 2 (inc' (quot n-len 2))))] (let [iterated-value (quot (+' init-value (quot n init-value)) 2)] (if (>= iterated-value init-value) init-value -- cgit v1.2.3-18-g5258