diff options
| author | Robert Griesemer <gri@golang.org> | 2020-01-30 12:26:20 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2020-01-30 20:37:01 +0000 |
| commit | 9bb40ed8ecb8e6e470c70e169cb3cecb2e9dc69a (patch) | |
| tree | 793cbd021c38c96ac481ebd48308336fb9c7d789 /src/math/big | |
| parent | 68b55ab51319ec71fe3f00266f9c467f34c824b1 (diff) | |
| download | go-9bb40ed8ecb8e6e470c70e169cb3cecb2e9dc69a.tar.xz | |
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>
Diffstat (limited to 'src/math/big')
| -rw-r--r-- | src/math/big/int.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/math/big/int.go b/src/math/big/int.go index bf1fa73cce..019af616d7 100644 --- a/src/math/big/int.go +++ b/src/math/big/int.go @@ -504,6 +504,8 @@ func (z *Int) Exp(x, y, m *Int) *Int { // GCD sets z to the greatest common divisor of a and b and returns z. // If x or y are not nil, GCD sets their value such that z = a*x + b*y. +// As of Go 1.14, a and b may be zero or negative (before Go 1.14 both +// a and b had to be > 0). // Regardless of the signs of a and b, z is always >= 0. // If a == b == 0, GCD sets z = x = y = 0. // If a == 0 and b != 0, GCD sets z = |b|, x = 0, y = sign(b) * 1. |
