[Gmp-commit] /var/hg/gmp-5.0: Fixed carry handling bug.

mercurial at gmplib.org mercurial at gmplib.org
Mon Feb 6 22:29:30 CET 2012


details:   /var/hg/gmp-5.0/rev/77785806d3f1
changeset: 13548:77785806d3f1
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Mon Feb 06 22:28:53 2012 +0100
description:
Fixed carry handling bug.

diffstat:

 ChangeLog          |  3 +++
 mpn/generic/hgcd.c |  4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r ec2c2959dc8c -r 77785806d3f1 ChangeLog
--- a/ChangeLog	Mon Feb 06 11:12:41 2012 +0100
+++ b/ChangeLog	Mon Feb 06 22:28:53 2012 +0100
@@ -1,5 +1,8 @@
 2012-02-06  Niels Möller  <nisse at lysator.liu.se>
 
+	* mpn/generic/hgcd.c (hgcd_matrix_update_q): Fixed carry handling
+	bug.
+
 	* tests/mpz/t-gcd.c (main): Omit tests with urandomb operands.
 	* tests/mpn/t-hgcd.c (main): Likewise.
 
diff -r ec2c2959dc8c -r 77785806d3f1 mpn/generic/hgcd.c
--- a/mpn/generic/hgcd.c	Mon Feb 06 11:12:41 2012 +0100
+++ b/mpn/generic/hgcd.c	Mon Feb 06 22:28:53 2012 +0100
@@ -115,8 +115,8 @@
       if (c[0] | c[1])
 	{
 	  M->n = n + qn + 1;
-	  M->p[0][col][n-1] = c[0];
-	  M->p[1][col][n-1] = c[1];
+	  M->p[0][col][M->n - 1] = c[0];
+	  M->p[1][col][M->n - 1] = c[1];
 	}
       else
 	{


More information about the gmp-commit mailing list