]> Cypherpunks repositories - gostls13.git/commitdiff
math: document that Min/Max differ from min/max
authorIan Lance Taylor <iant@golang.org>
Tue, 6 Jun 2023 21:31:21 +0000 (14:31 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 15 Jun 2023 19:45:12 +0000 (19:45 +0000)
For #59488
Fixes #60616

Change-Id: Idf9f42d7d868999664652dd7b478684a474f1d96
Reviewed-on: https://go-review.googlesource.com/c/go/+/501355
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

src/math/dim.go

index 6a286cdc75a46fe34206e347f984bc0ac2a17f05..f369f70f000fbb69823dfe987af6b6ac0191c756 100644 (file)
@@ -34,6 +34,9 @@ func Dim(x, y float64) float64 {
 //     Max(x, NaN) = Max(NaN, x) = NaN
 //     Max(+0, ±0) = Max(±0, +0) = +0
 //     Max(-0, -0) = -0
+//
+// Note that this differs from the built-in function max when called
+// with NaN and +Inf.
 func Max(x, y float64) float64 {
        if haveArchMax {
                return archMax(x, y)
@@ -67,6 +70,9 @@ func max(x, y float64) float64 {
 //     Min(x, -Inf) = Min(-Inf, x) = -Inf
 //     Min(x, NaN) = Min(NaN, x) = NaN
 //     Min(-0, ±0) = Min(±0, -0) = -0
+//
+// Note that this differs from the built-in function min when called
+// with NaN and -Inf.
 func Min(x, y float64) float64 {
        if haveArchMin {
                return archMin(x, y)