Clojure numbers default to their host implementation, which refers to the JVM in most cases. So,
1 is of type
0.1 is of the
(type 1) java.lang.Long (type 0.1) java.lang.Double
Clojure supports Java's primitive number types of
float. These symbols also correspond to Clojure functions, which convert to a native type. This is useful when dealing with a function where a particular type hints at a primitive number:
(defn double' ^long [^long n] (+ n n)) (double' (int 4)) 8
Clojure also supports native JVM numeric types, such as Byte, Short, Integer, Long, BigInteger, Float, Double, and BigDecimal. Larger numbers in Clojure have custom types because they require ...