mirror of https://github.com/golang/go.git
Merge 5594631279 into 49cdf0c42e
This commit is contained in:
commit
b131528f36
|
|
@ -21,15 +21,14 @@ type Interface interface {
|
||||||
// Less reports whether the element with index i
|
// Less reports whether the element with index i
|
||||||
// must sort before the element with index j.
|
// must sort before the element with index j.
|
||||||
//
|
//
|
||||||
|
// Less must satisfy strict weak ordering.
|
||||||
|
// https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings
|
||||||
|
//
|
||||||
// If both Less(i, j) and Less(j, i) are false,
|
// If both Less(i, j) and Less(j, i) are false,
|
||||||
// then the elements at index i and j are considered equal.
|
// then the elements at index i and j are considered equal.
|
||||||
// Sort may place equal elements in any order in the final result,
|
// Sort may place equal elements in any order in the final result,
|
||||||
// while Stable preserves the original input order of equal elements.
|
// while Stable preserves the original input order of equal elements.
|
||||||
//
|
//
|
||||||
// Less must describe a transitive ordering:
|
|
||||||
// - if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well.
|
|
||||||
// - if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well.
|
|
||||||
//
|
|
||||||
// Note that floating-point comparison (the < operator on float32 or float64 values)
|
// Note that floating-point comparison (the < operator on float32 or float64 values)
|
||||||
// is not a transitive ordering when not-a-number (NaN) values are involved.
|
// is not a transitive ordering when not-a-number (NaN) values are involved.
|
||||||
// See Float64Slice.Less for a correct implementation for floating-point values.
|
// See Float64Slice.Less for a correct implementation for floating-point values.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue