store/[org.clojure/clojure "1.8.0"] clj::clojure.core/int

Official Documentation

Add notes
Arities
==================================================
   [x]

Docstring
==================================================
  Coerce to int

Source

(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)))

Example 1

Edit
(int 1)
;; => 1

(int 1M)
;; => 1

(int 1.2)
;; => 1

(int \1)
;; => 49

(int \a)
;; => 97

(int "1")
;; => java.lang.ClassCastException: ...

Uses on crossclj