number method is a number test method. It is used to test if a number is a number and not a string or any other data type.
number method accepts just one parameter, which it will test to see if it is a number.
number method returns true if the value passed is a
number. It will return false if the value is not a
We use this method to avoid unnecessary errors arising while carrying out calculations involving numbers.
(ns clojure.examples.hello (:gen-class)) (defn numba  (def x (number? :a)) (println x) (def x (number? -1)) (println x) (def x (number? 9)) (println x)) (numba)
ais not a number.
-1is a number even though it is negative.
9is a number.
numbafunction to execute the code.
View all Courses