--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Now, Scala's == does NOT just call down to Java's. It special cases comparisons with primitives, because Scala doesn't differentiate between boxed/unboxed primitives. It has to choose 1 behaviour or the other. It can't choose both and no matter which it choses, it's going to be wrong in the other case. Choosing the behaviour specified by the IEEE spec is absolutely the right thing to do. Java's boxed NaN's should've done the same, honestly.
Sure. so subtypes can't have a more specific definition of equality than their super type. Which rather defeats the point of subtyping.
Sure. so subtypes can't have a more specific definition of equality than their super type. Which rather defeats the point of subtyping.
I would question whether it ever makes sense to test floating points for equality, given their approximate nature. Can't think of a use-case.
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
And even if you have a set of double values that compare as expected, I could still not imagine what the use case could be.
On Tue, Apr 22, 2014 at 7:39 AM, Oliver Ruebenacker <cur...@gmail.com> wrote:Handling division by zero.
> I would question whether it ever makes sense to test floating points for
> equality, given their approximate nature. Can't think of a use-case.
Or reading in a file that's a list of
floating point numbers with 0.0 as a terminator.
--
Kie ekzistas vivo, ekzistas espero.
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Kie ekzistas vivo, ekzistas espero.
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
So when is the scala standard library getting a typeclass-based equality? ;)