fixes #5104 and related NaN ordering inconsistencies #76

Merged
merged 1 commit into from Dec 27, 2011

Projects

None yet

2 participants

@khernyo
Contributor
khernyo commented Dec 25, 2011

The bug was caused by the inconsistency between j.l.Math.min() and
j.l.Double.compareTo() wrt NaN (j.l.Math.min() considers NaN to be
less than any other value while j.l.Double.compareTo() says it's
greater...)

The fix changes Ordering.{FloatOrdering,DoubleOrdering) to base
it's results on primitive comparisons and math.{min,max} instead
of j.l.{Float,Double}.compareTo()

@khernyo khernyo fixes #5104 and related NaN ordering inconsistencies
The bug was caused by the inconsistency between j.l.Math.min() and
j.l.Double.compareTo() wrt NaN (j.l.Math.min() considers NaN to be
less than any other value while j.l.Double.compareTo() says it's
greater...)

The fix changes Ordering.{FloatOrdering,DoubleOrdering) to base
it's results on primitive comparisons and math.{min,max} instead
of j.l.{Float,Double}.compareTo()
460bbc1
@paulp paulp merged commit 460bbc1 into scala:master Dec 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment