Skip to content

Commit 9bb40ed

Browse files
committed
math/big: update comment on Int.GCD
Per the suggestion https://golang.org/cl/216200/2/doc/go1.14.html#423. Updates #28878. Change-Id: I654d2d114409624219a0041916f0a4030efc7573 Reviewed-on: https://go-review.googlesource.com/c/go/+/217104 Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 parent 68b55ab commit 9bb40ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/math/big/int.go

+2
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ func (z *Int) Exp(x, y, m *Int) *Int {
504504

505505
// GCD sets z to the greatest common divisor of a and b and returns z.
506506
// If x or y are not nil, GCD sets their value such that z = a*x + b*y.
507+
// As of Go 1.14, a and b may be zero or negative (before Go 1.14 both
508+
// a and b had to be > 0).
507509
// Regardless of the signs of a and b, z is always >= 0.
508510
// If a == b == 0, GCD sets z = x = y = 0.
509511
// If a == 0 and b != 0, GCD sets z = |b|, x = 0, y = sign(b) * 1.

0 commit comments

Comments
 (0)