diff options
| author | Brian Kessler <brian.m.kessler@gmail.com> | 2019-02-12 22:21:42 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2019-11-07 06:58:44 +0000 |
| commit | f5949b60676bc253aca36fea91f9542e6d517f9e (patch) | |
| tree | 4ad93767b0a8574fc8ae016514c35de197d7b655 /src/cmd/doc | |
| parent | a8f57f4adad2122b42ea05024b61e93442788289 (diff) | |
| download | go-f5949b60676bc253aca36fea91f9542e6d517f9e.tar.xz | |
math/big: allow all values for GCD
Allow the inputs a and b to be zero or negative to GCD
with the following definitions.
If x or y are not nil, GCD sets their value such that z = a*x + b*y.
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.
If a != 0 and b == 0, GCD sets z = |a|, x = sign(a) * 1, y = 0.
Fixes #28878
Change-Id: Ia83fce66912a96545c95cd8df0549bfd852652f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/164972
Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/doc')
0 files changed, 0 insertions, 0 deletions
