I was testing some of the code in Miclael Fogus & Chris Houser's The Joy of 
Clojure and found this:
 
Clojure 1.4.0
user=> (let [a (+ 0.1 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M)]
  (println (class a))
  a)
java.lang.Double
0.9999999999999999
user=> (let [b (+ 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1)]
  (println (class b))
  b)
java.lang.Double
1.0
user=>
 
Can anyone help by explaining why a and b are not equal?  I figure it has 
something to do with the reduce1 function.
 
Thanks!
 
-Kevin

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to