> 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.
>
>
Ah, yeah, fair enough. I would merely like to have floating point hash codes
that match floating point equality.

In other words, if we were to stick with the status quo where (= 0.3 0.3M)
=> true and (= 3/10 0.3) => true, then it would be nice to get BigDec hash
codes that match Double hash codes.

But you're right that Rich's message suggests we're moving to a world where
(= 0.3 0.3M) => false. I hadn't realized the (good) consequences for
floating point equality. In that world, you're right about hash codes. I
also see what you mean about contagion.

Personally, I think (= 3 3M) => true and (= 3/10 0.3M) => true would be nice
to have, given that (= 3 3N) => true. Both are currently false in equiv. I
also think (= 3.0M 3.00M) => true would be nice. As Rich said, there's no
particular reason to have Clojure = work exactly like Java .equals(). I
think all it would take is a call to .stripTrailingZeros() on each =
comparison of a BigDecimal.

Garth

-- 
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