float?

added
1.0

ns
clojure.core

type
function

(float? n)

Returns true if n is a floating point number

                user=> (float? 0)
false
user=> (float? 0.0)
true
            
                ;; float? returns true for both float and double.
user=> (map (juxt type float?) [(float 1) (double 1)])
([java.lang.Float true] [java.lang.Double true])

;; Call instance? to check if the value is specifically float or double.
user=> (map (juxt type #(instance? Float %)) [(float 1) (double 1)])
([java.lang.Float true] [java.lang.Double false])