You're viewing version 1.2.0 of numerator. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

numerator

clojure.core

  • (numerator r)
Returns the numerator part of a Ratio.

1 Example top

  • ;; note that the function always returns the numerator of the reduced fraction
    
    user=> (map numerator [(/ 2 4) (/ 4 6) (/ 6 8)])
    (1 2 3)
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:2748 top

(defn numerator
  "Returns the numerator part of a Ratio."
  {:tag BigInteger
   :added "1.2"}
  [r]
  (.numerator ^clojure.lang.Ratio r))
Vars in clojure.core/numerator: defn
Used in 0 other vars

Comments top

No comments for numerator. Log in to add a comment.