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

decimal?

clojure.core

  • (decimal? n)
Returns true if n is a BigDecimal

1 Example top

  • user=> (decimal? 1)
    false
    
    user=> (decimal? 1.0)
    false
    
    user=> (decimal? 1M)
    true
    
    user=> (decimal? 99999999999999999999999999999999999)
    false
    
    user=> (decimal? 1.0M)
    true
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:2762 top

(defn decimal?
  "Returns true if n is a BigDecimal"
  {:added "1.0"}
  [n] (instance? BigDecimal n))
Vars in clojure.core/decimal?: defn instance?
Used in 3 other vars bigdec bigint rational?

Comments top

No comments for decimal?. Log in to add a comment.