summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorMalte Isberner <malte.isberner@gmail.com>2014-07-21 22:10:09 -0700
committerAntoine Gourlay <antoine@gourlay.fr>2014-08-11 17:55:49 +0200
commitcb2cfc0bf608a45c5a9948152aae55ce455c4e14 (patch)
treee27409f4e8f03997484e79ee9fa33a3907d0759e /src/library
parentb70b074d20edf0001dce5c14775ee96054b9bae2 (diff)
downloadscala-cb2cfc0bf608a45c5a9948152aae55ce455c4e14.tar.gz
scala-cb2cfc0bf608a45c5a9948152aae55ce455c4e14.tar.bz2
scala-cb2cfc0bf608a45c5a9948152aae55ce455c4e14.zip
[backport] Fixed mathematically wrong statement in the documentation of scala.math.PartialOrdering.
- Previous (misleading) documentation suggested that a partial ordering *is* an equivalence relation. This has now been clarified. - Existing documentation on properties of partial orderings (reflexive, transitive, antisymmetric) had several formatting inconsistencies that have now been remove. (cherry picked from commit 528df5becee03175e7462b64d7c22460cc5992f7)
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/math/PartialOrdering.scala17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/library/scala/math/PartialOrdering.scala b/src/library/scala/math/PartialOrdering.scala
index 9e35381528..8d7fc32535 100644
--- a/src/library/scala/math/PartialOrdering.scala
+++ b/src/library/scala/math/PartialOrdering.scala
@@ -15,17 +15,24 @@ package math
* latter.
*
* A [[http://en.wikipedia.org/wiki/Partial_order partial ordering]] is a
- * binary relation on a type `T` that is also an equivalence relation on
- * values of type `T`. This relation is exposed as the `lteq` method of
- * the `PartialOrdering` trait. This relation must be:
+ * binary relation on a type `T`, exposed as the `lteq` method of this trait.
+ * This relation must be:
*
* - reflexive: `lteq(x, x) == '''true'''`, for any `x` of type `T`.
- * - anti-symmetric: `lteq(x, y) == '''true'''` and `lteq(y, x) == true`
- * then `equiv(x, y)`, for any `x` and `y` of type `T`.
+ * - anti-symmetric: if `lteq(x, y) == '''true'''` and
+ * `lteq(y, x) == '''true'''`
+ * then `equiv(x, y) == '''true'''`, for any `x` and `y` of type `T`.
* - transitive: if `lteq(x, y) == '''true'''` and
* `lteq(y, z) == '''true'''` then `lteq(x, z) == '''true'''`,
* for any `x`, `y`, and `z` of type `T`.
*
+ * Additionally, a partial ordering induces an
+ * [[http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]]
+ * on a type `T`: `x` and `y` of type `T` are equivalent if and only if
+ * `lteq(x, y) && lteq(y, x) == '''true'''`. This equivalence relation is
+ * exposed as the `equiv` method, inherited from the
+ * [[scala.math.Equiv Equiv]] trait.
+ *
* @author Geoffrey Washburn
* @version 1.0, 2008-04-0-3
* @since 2.7