Clojure - float?


Advertisements

Returns true if the number is a float.

Syntax

Following is the syntax.

(float? number)

Example

Following is an example of the float test function.

(ns clojure.examples.hello
   (:gen-class))

;; This program displays Hello World
(defn Example []
   (def x (float? 0))
   (println x)
   
   (def x (float? 0.0))
   (println x))
(Example)

Output

The above program produces the following output.

false
true
clojure_numbers.htm
Advertisements