Clojure – zero?

Clojure zero?

In this guide, we will discuss Clojure Zero? . Returns true if the number is zero, else false.

Syntax

Following is the syntax.

(zero? number)

Example

Following is an example of the zero test function.

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

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

Output

The above program produces the following output.

true
true
false

Next Topic : Click Here

This Post Has One Comment

Leave a Reply