aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/math.clj
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2009-01-25 05:04:43 +0000
committerChouser <chouser@n01se.net>2009-01-25 05:04:43 +0000
commit4b3370f176d9adc58165ccff0c8bc4a2a9f57573 (patch)
tree7f35ff48a501d4192513165257617a926641beec /src/clojure/contrib/math.clj
parente391c855d57ada7756b7cae5548bff80cc9e5fec (diff)
math: remove 'mod' (was added to Clojure svn rev 1227)
Diffstat (limited to 'src/clojure/contrib/math.clj')
-rw-r--r--src/clojure/contrib/math.clj11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/clojure/contrib/math.clj b/src/clojure/contrib/math.clj
index 942b4af6..0f4ff622 100644
--- a/src/clojure/contrib/math.clj
+++ b/src/clojure/contrib/math.clj
@@ -114,15 +114,6 @@ round always returns an integer. Rounds up for values exactly in between two in
(defmethod round clojure.lang.Ratio [n] (floor (+ n 1/2)))
(defmethod round :default [n] (Math/round n))
-; mod is private because it is likely to be incorporated into Clojure's core
-(defn- mod [a b]
- (cond
- (or (not (integer? a)) (not (integer? b))) (throw (IllegalArgumentException.
- "mod requires two integers"))
-
- (or (< a 0 b) (< b 0 a)) (+ (rem a b) b)
- :else (rem a b)))
-
(defn gcd "(gcd a b) returns the greatest common divisor of a and b" [a b]
(if (or (not (integer? a)) (not (integer? b)))
(throw (IllegalArgumentException. "gcd requires two integers"))
@@ -199,4 +190,4 @@ For example, (exact-integer-sqrt 15) is [3 6] because 15 = 3^2+6."
sqrtfrac))))
(defmethod sqrt :default [n]
- (Math/sqrt n)) \ No newline at end of file
+ (Math/sqrt n))