1.3.0 permalink 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:3175 top

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

Comments top

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