int?

added
1.9

ns
clojure.core

type
function

(int? x)

Return true if x is a fixed precision integer

                ;; Note that this will return true for things which aren't strictly Java ints:
(int? 42)                       
;; => true

(int? (java.lang.Integer. 42))  
;; => true

(int? (java.lang.Long. 42))     
;; => true

(int? 42.0)
;; => false

(int? (bigdec 42))
;; => false

;; The distinction between int? and integer? is that integer? will return true 
;; for BigInts:

(int? (bigint 42))        
;; => false

(integer? (bigint 42))    
;; => true

(int? java.math.BigInteger/ONE)
;; => false

(integer? java.math.BigInteger/ONE)
;; => true