A couple points of clarification: On Fri, Jun 25, 2010 at 1:35 PM, Mark Engelberg <mark.engelb...@gmail.com> wrote: > You don't want the hashCode of bigdecimal to match the corresponding > double. They aren't equal, so they shouldn't have the same hashcode. > They aren't equal because one is exact and one is inexact.
I should have said "they shouldn't be equal" based on Rich Hickey's explanation that from now on (= 1 1.0) will return false. I think by this logic (= 1.0M 1.0) should also be false. I have no idea what the current branch actually does though -- haven't tried it yet. > > Now, one interesting question is whether the hashCode of 40.0M should > match the hashCode for 40N, because they are two exact numbers that > represent the same value. > The more I think about it, the more I think that big decimals are sort of their own universe and we really wouldn't want the hashCodes of an integral bigdecimal to match the integer hashcode. I mean, if 40.0M and 40.00M are considered different by Java, it seems fruitless to try to unify these with their integer counterparts. -- 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