clojure clojure.core Comparison Operators in Clojure

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Comparisons are functions in clojure. What that means in (2>1) is (> 2 1) in clojure. Here are all the comparison operators in clojure.

  1. Greater Than

(> 2 1) ;; true
(> 1 2) ;; false

  1. Less Than

(< 2 1) ;; false

  1. Greater Than or Equal To

(>= 2 1) ;; true
(>= 2 2) ;; true
(>= 1 2) ;; false

  1. Less Than or Equal To

(<= 2 1) ;; false
(<= 2 2) ;; true
(<= 1 2) ;; true

  1. Equal To

(= 2 2) ;; true
(= 2 10) ;; false

  1. Not Equal To

(not= 2 2) ;; false
(not= 2 10) ;; true



Got any clojure Question?