@@ -382,8 +382,15 @@ object Ordering extends LowPriorityOrderingImplicits {
382
382
383
383
/** `Ordering`s for `Float`s.
384
384
*
385
- * The behavior of the comparison operations provided by the default (implicit)
386
- * ordering on `Float` changed in 2.10.0 and 2.13.0.
385
+ * The default extends `Ordering.Float.TotalOrdering`.
386
+ *
387
+ * `Ordering.Float.TotalOrdering` uses the `java.lang.Float.compare` semantics for all operations.
388
+ * Scala also provides the `Ordering.Float.IeeeOrdering` semantics. Which uses the IEEE 754 semantics
389
+ * for float ordering.
390
+ *
391
+ * Historically: `IeeeOrdering` was used in Scala from 2.10.x through 2.12.x. This changed in 2.13.0
392
+ * to `TotalOrdering`.
393
+ *
387
394
* Prior to Scala 2.10.0, the `Ordering` instance used semantics
388
395
* consistent with `java.lang.Float.compare`.
389
396
*
@@ -394,11 +401,6 @@ object Ordering extends LowPriorityOrderingImplicits {
394
401
* `false` thus `0.0F < Float.NaN`, `0.0F > Float.NaN`, and
395
402
* `Float.NaN == Float.NaN` all yield `false`, analogous `None` in `flatMap`.
396
403
*
397
- * Recognizing the limitation of the IEEE 754 semantics in terms of ordering,
398
- * Scala 2.13.0 created two instances: `Ordering.Float.IeeeOrdering`, which retains
399
- * the IEEE 754 semantics from Scala 2.12.x, and `Ordering.Float.TotalOrdering`,
400
- * which brings back the `java.lang.Float.compare` semantics for all operations.
401
- * The default extends `TotalOrdering`.
402
404
*
403
405
* {{{
404
406
* List(0.0F, 1.0F, 0.0F / 0.0F, -1.0F / 0.0F).sorted // List(-Infinity, 0.0, 1.0, NaN)
0 commit comments