Clojure - number?



Returns true if the number is really a Number.

Syntax

Following is the syntax.

(number? number)

Example

Following is an example of the number test function.

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

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

Output

The above program produces the following output.

true
true
false
clojure_numbers.htm
Advertisements