Number comparison gotchas in Clojure
Notes
;; number_comparison_gotchas.clj
(= 7 7)
(= 7 7.0)
(= (double 7) 7.0)
(= 7.0 7.0)
(= 7 7.0M)
(= 7.0 7.0M)
(= 7.0 (double 7.0M))
(= 7 7/1)
(double 1/3)
Notes
;; number_comparison_gotchas.clj
(= 7 7)
(= 7 7.0)
(= (double 7) 7.0)
(= 7.0 7.0)
(= 7 7.0M)
(= 7.0 7.0M)
(= 7.0 (double 7.0M))
(= 7 7/1)
(double 1/3)