mirror of
https://github.com/golang/go
synced 2024-11-18 04:44:46 -07:00
sort: clarify comment about not-a-number values
Updates #20540 Change-Id: I864008fadd77b0aeb10fe7e7f1ec696516a5add5 Reviewed-on: https://go-review.googlesource.com/44492 Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
3bdc2f3abf
commit
da1b83067d
@ -315,7 +315,7 @@ func (p IntSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
|
|||||||
func (p IntSlice) Sort() { Sort(p) }
|
func (p IntSlice) Sort() { Sort(p) }
|
||||||
|
|
||||||
// Float64Slice attaches the methods of Interface to []float64, sorting in increasing order
|
// Float64Slice attaches the methods of Interface to []float64, sorting in increasing order
|
||||||
// (not-a-number values are treated as less than any ordinary number).
|
// (not-a-number values are treated as less than other values).
|
||||||
type Float64Slice []float64
|
type Float64Slice []float64
|
||||||
|
|
||||||
func (p Float64Slice) Len() int { return len(p) }
|
func (p Float64Slice) Len() int { return len(p) }
|
||||||
@ -346,7 +346,7 @@ func (p StringSlice) Sort() { Sort(p) }
|
|||||||
func Ints(a []int) { Sort(IntSlice(a)) }
|
func Ints(a []int) { Sort(IntSlice(a)) }
|
||||||
|
|
||||||
// Float64s sorts a slice of float64s in increasing order
|
// Float64s sorts a slice of float64s in increasing order
|
||||||
// (not-a-number values are treated as less than any ordinary number).
|
// (not-a-number values are treated as less than other values).
|
||||||
func Float64s(a []float64) { Sort(Float64Slice(a)) }
|
func Float64s(a []float64) { Sort(Float64Slice(a)) }
|
||||||
|
|
||||||
// Strings sorts a slice of strings in increasing order.
|
// Strings sorts a slice of strings in increasing order.
|
||||||
@ -356,7 +356,7 @@ func Strings(a []string) { Sort(StringSlice(a)) }
|
|||||||
func IntsAreSorted(a []int) bool { return IsSorted(IntSlice(a)) }
|
func IntsAreSorted(a []int) bool { return IsSorted(IntSlice(a)) }
|
||||||
|
|
||||||
// Float64sAreSorted tests whether a slice of float64s is sorted in increasing order
|
// Float64sAreSorted tests whether a slice of float64s is sorted in increasing order
|
||||||
// (not-a-number values are treated as less than any ordinary number).
|
// (not-a-number values are treated as less than other values).
|
||||||
func Float64sAreSorted(a []float64) bool { return IsSorted(Float64Slice(a)) }
|
func Float64sAreSorted(a []float64) bool { return IsSorted(Float64Slice(a)) }
|
||||||
|
|
||||||
// StringsAreSorted tests whether a slice of strings is sorted in increasing order.
|
// StringsAreSorted tests whether a slice of strings is sorted in increasing order.
|
||||||
|
Loading…
Reference in New Issue
Block a user