Number comparison gotchas in Clojure

less than 1 minute read

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)

Updated: