==

added
1.0

ns
clojure.core

type
function

(== x) (== x y) (== x y & more)

Returns non-nil if nums all have the equivalent
value (type-independent), otherwise false

                ;; true:
(== 1)
(== 1 1)       
(== 1/1, 2/2, 3/3, 4/4)   
(== 1, 1.0, 1/1)
(== :foo)


;; false:
(== 1 2)

;; ClassCastException
(== 1 \\1)
(== 1 "1")
            
                user=> (= 0.0 0)
false
user=> (== 0.0 0)
true
            
                ;; Just what you would expect
(== 2.0 1.9999999)
;;=> false

;; a suprising result
(== 2.0 2 6/3 1.9999999999999999)
;;=> true ??!?
;; Yes, there is some rounding off going on.
;; if you take off just one of the repeating 9 (on my machine) these compare.

            
                
;; When floating point numbers are far enough from each other
(== 2.0 1.9999999)
;;=> false
(- 100.0 100.00000000000001)  ;13(Thirteen) 0s after floating point in the last number
;;=> -1.4210854715202004E-14

;; When two floating point numbers are too close some basic algebraic properties don't strictly hold.
(== 2.0 1.9999999999999999)
;;=> true

(* 100 (- 1.0 1.0000000000000001))  ;15(fifteen) 0s after floating point in the last number
;;=> 0.0

;; They are still different types
(= 2 1.9999999999999999)
;;=> false

;; see more from https://en.wikibooks.org/wiki/Floating_Point/Epsilon
;; I found above example was distracting by putting 6/3 and 2 in the equality check that is why I decided to write up a similar but new example.