Skip to content

Commit 65db95d

Browse files
ianlancetaylorgopherbot
authored andcommitted
math: document that Min/Max differ from min/max
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>
1 parent 60e6afb commit 65db95d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/math/dim.go

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func Dim(x, y float64) float64 {
3434
// Max(x, NaN) = Max(NaN, x) = NaN
3535
// Max(+0, ±0) = Max(±0, +0) = +0
3636
// Max(-0, -0) = -0
37+
//
38+
// Note that this differs from the built-in function max when called
39+
// with NaN and +Inf.
3740
func Max(x, y float64) float64 {
3841
if haveArchMax {
3942
return archMax(x, y)
@@ -67,6 +70,9 @@ func max(x, y float64) float64 {
6770
// Min(x, -Inf) = Min(-Inf, x) = -Inf
6871
// Min(x, NaN) = Min(NaN, x) = NaN
6972
// Min(-0, ±0) = Min(±0, -0) = -0
73+
//
74+
// Note that this differs from the built-in function min when called
75+
// with NaN and -Inf.
7076
func Min(x, y float64) float64 {
7177
if haveArchMin {
7278
return archMin(x, y)

0 commit comments

Comments
 (0)