In this guide, we will discuss Clojure neg? . Returns true if number is less than zero, else false.
Syntax
Following is the syntax.
(neg? number)
Example
Following is an example of the neg test function.
(ns clojure.examples.hello (:gen-class)) ;; This program displays Hello World (defn Example [] (def x (neg? -1)) (println x) (def x (neg? 0)) (println x) (def x (neg? 1)) (println x)) (Example)
Output
The above program produces the following output.
true false false
Next Topic : Click Here
Pingback: Clojure - pos? | Adglob Infosystem Pvt Ltd
Pingback: Clojure - Numbers | Adglob Infosystem Pvt Ltd