slices: add package-level documentation for less function

Document that the less function requires strict weak ordering.

Fixes golang/go#52518

Change-Id: Ia2d5f3137932b4c0fb0da4bfdf12f8d69b2672de
Reviewed-on: https://go-review.googlesource.com/c/exp/+/402534
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eli Bendersky <eliben@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Keith Randall <khr@google.com>
diff --git a/slices/slices.go b/slices/slices.go
index df78daf..8a237c5 100644
--- a/slices/slices.go
+++ b/slices/slices.go
@@ -5,6 +5,11 @@
 // Package slices defines various functions useful with slices of any type.
 // Unless otherwise specified, these functions all apply to the elements
 // of a slice at index 0 <= i < len(s).
+//
+// Note that the less function in IsSortedFunc, SortFunc, SortStableFunc requires a
+// strict weak ordering (https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings),
+// or the sorting may fail to sort correctly. A common case is when sorting slices of
+// floating-point numbers containing NaN values.
 package slices
 
 import "golang.org/x/exp/constraints"