summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/core.clj12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index e2cf386e..1f46b487 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -2402,6 +2402,18 @@
"Returns true if n is a Ratio"
[n] (instance? clojure.lang.Ratio n))
+(defn numerator
+ "Returns the numerator part of a Ratio."
+ {:tag BigInteger}
+ [r]
+ (.numerator #^clojure.lang.Ratio r))
+
+(defn denominator
+ "Returns the denominator part of a Ratio."
+ {:tag BigInteger}
+ [r]
+ (.denominator #^clojure.lang.Ratio r))
+
(defn decimal?
"Returns true if n is a BigDecimal"
[n] (instance? BigDecimal n))