- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
min and max with Double.NaN
I found something, that's an issue in my opinion.
I expected that min and max of something and NaN is equal.
min(0, Double.NaN) == max(0, Double.NaN)
In both cases I have the same problem (I can't compare NaN with a
number), so I expect the same result of min and max.
As you can see at " https://issues.scala-lang.org/browse/SI-5104 " I
already tried to solve the problem. The best solution that I can see,
would be to think arithmetically max(x,y) = avg(x ,y) + abs(x - y) /
2. But that may effect other code...
What do you think about it?