aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorBrian Kessler <brian.m.kessler@gmail.com>2019-02-12 22:21:42 -0700
committerRobert Griesemer <gri@golang.org>2019-11-07 06:58:44 +0000
commitf5949b60676bc253aca36fea91f9542e6d517f9e (patch)
tree4ad93767b0a8574fc8ae016514c35de197d7b655 /src/cmd
parenta8f57f4adad2122b42ea05024b61e93442788289 (diff)
downloadgo-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')
0 files changed, 0 insertions, 0 deletions