@@ -314,7 +314,8 @@ func (p IntSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
314
314
// Sort is a convenience method.
315
315
func (p IntSlice ) Sort () { Sort (p ) }
316
316
317
- // Float64Slice attaches the methods of Interface to []float64, sorting in increasing order.
317
+ // Float64Slice attaches the methods of Interface to []float64, sorting in increasing order
318
+ // (not-a-number values are treated as less than any ordinary number).
318
319
type Float64Slice []float64
319
320
320
321
func (p Float64Slice ) Len () int { return len (p ) }
@@ -344,7 +345,8 @@ func (p StringSlice) Sort() { Sort(p) }
344
345
// Ints sorts a slice of ints in increasing order.
345
346
func Ints (a []int ) { Sort (IntSlice (a )) }
346
347
347
- // Float64s sorts a slice of float64s in increasing order.
348
+ // Float64s sorts a slice of float64s in increasing order
349
+ // (not-a-number values are treated as less than any ordinary number).
348
350
func Float64s (a []float64 ) { Sort (Float64Slice (a )) }
349
351
350
352
// Strings sorts a slice of strings in increasing order.
@@ -353,7 +355,8 @@ func Strings(a []string) { Sort(StringSlice(a)) }
353
355
// IntsAreSorted tests whether a slice of ints is sorted in increasing order.
354
356
func IntsAreSorted (a []int ) bool { return IsSorted (IntSlice (a )) }
355
357
356
- // Float64sAreSorted tests whether a slice of float64s is sorted in increasing order.
358
+ // Float64sAreSorted tests whether a slice of float64s is sorted in increasing order
359
+ // (not-a-number values are treated as less than any ordinary number).
357
360
func Float64sAreSorted (a []float64 ) bool { return IsSorted (Float64Slice (a )) }
358
361
359
362
// StringsAreSorted tests whether a slice of strings is sorted in increasing order.
0 commit comments