diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-02-09 17:16:42 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-02-09 17:16:42 +0000 |
commit | 3586754272ab23f014acf5f3aab3e8ce8202fc00 (patch) | |
tree | 0c4e9443688c8b16d051d4a7ad9365318d1dc746 | |
parent | b839feb8acfa87d500c4d1bd273e801429dce8ea (diff) |
fixed Ratio->bigdec, patch from jbondeson
-rw-r--r-- | src/clj/clojure/core.clj | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 37a063aa..b958b7eb 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -1894,6 +1894,7 @@ [x] (cond (decimal? x) x (float? x) (. BigDecimal valueOf (double x)) + (ratio? x) (/ (BigDecimal. (.numerator x)) (.denominator x)) (instance? BigInteger x) (BigDecimal. #^BigInteger x) (number? x) (BigDecimal/valueOf (long x)) :else (BigDecimal. x))) |