float

added
1.0

ns
clojure.core

type
function

(float x)

Coerce to float

                (float 1)
;;=> 1.0
(float 1.11)
;;=> 1.11
(float 1.111111111111111111111111111M)
;;=> 1.1111112

;;;; Note that (float) range checks its argument and throws an exception
;;;; if the value is out of range.
;;;; Use (unchecked-float) instead if you want to skip the range checks.

(float Double/MAX_VALUE)
;;=> IllegalArgumentException Value out of range for float: 1.7976931348623157E308
(unchecked-float Double/MAX_VALUE)
;;=> Infinity