• (int x)
Coerce to int

1 Example top

  • user=> (int 1)
    1
    
    user=> (int 1M)
    1
    
    user=> (int 1.2)
    1
    
    user=> (int \1)
    49
    
    user=> (int \a)
    97
    
    user=> (int "1")
    java.lang.ClassCastException: ...
    
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:817 top

(defn int
  "Coerce to int"
  {
   :inline (fn  [x] `(. clojure.lang.RT (~(if *unchecked-math* 'uncheckedIntCast 'intCast) ~x)))
   :added "1.0"}
  [x] (. clojure.lang.RT (intCast x)))
Vars in clojure.core/int:
Used in 0 other vars

Comments top

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