Rationals vs Decimals in Clojure

January 2016 · 1 minute read
(let [a 1.0e50
      b -1.0e50
      c 17.0e00]
  (= (+ (+ a b) c) (+ a (+ b c)))) ; => false

From the above example, one can infer that decimals are subjected to Floating Point corruption. You can find more examples here.

comments powered by Disqus