-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug#10511 Add total orderings for Float and Double
Add total orderings for Float and Double, so that there are two implicit orderings for each in scope: one consistent with a total ordering, and one consistent with IEEE spec.
- Loading branch information
Showing
12 changed files
with
245 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
t10511.scala:2: error: ambiguous implicit values: | ||
both object FloatTotalOrdering in object Ordering of type scala.math.Ordering.FloatTotalOrdering.type | ||
and object FloatIeeeOrdering in object Ordering of type scala.math.Ordering.FloatIeeeOrdering.type | ||
match expected type scala.math.Ordering[Float] | ||
val f = Ordering[Float] | ||
^ | ||
t10511.scala:3: error: ambiguous implicit values: | ||
both object DoubleTotalOrdering in object Ordering of type scala.math.Ordering.DoubleTotalOrdering.type | ||
and object DoubleIeeeOrdering in object Ordering of type scala.math.Ordering.DoubleIeeeOrdering.type | ||
match expected type scala.math.Ordering[Double] | ||
val d = Ordering[Double] | ||
^ | ||
t10511.scala:6: error: ambiguous implicit values: | ||
both object DoubleTotalOrdering in object Ordering of type scala.math.Ordering.DoubleTotalOrdering.type | ||
and object DoubleIeeeOrdering in object Ordering of type scala.math.Ordering.DoubleIeeeOrdering.type | ||
match expected type scala.math.Ordering[Double] | ||
list.sorted | ||
^ | ||
three errors found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
object Test { | ||
val f = Ordering[Float] | ||
val d = Ordering[Double] | ||
|
||
val list = List(1.0, 2.0, 3.0) | ||
list.sorted | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
|
||
import scala.math.Ordering.DoubleIeeeOrdering | ||
|
||
object Test { | ||
|
||
|
Oops, something went wrong.