Clojure – number?

Clojure number?

In this guide, we will discuss 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

Next Topic : Click Here

This Post Has 3 Comments

Leave a Reply