[Gmp-commit] /home/hgfiles/gmp: (compute_v): Normalize tp[] after mpn_mul.

mercurial at gmplib.org mercurial at gmplib.org
Sun Dec 13 16:50:40 CET 2009


details:   /home/hgfiles/gmp/rev/20c811bc3f8f
changeset: 13056:20c811bc3f8f
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Dec 13 16:50:36 2009 +0100
description:
(compute_v): Normalize tp[] after mpn_mul.

diffstat:

 ChangeLog            |  2 ++
 mpn/generic/gcdext.c |  1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r f3afc6947316 -r 20c811bc3f8f ChangeLog
--- a/ChangeLog	Sun Dec 13 16:34:18 2009 +0100
+++ b/ChangeLog	Sun Dec 13 16:50:36 2009 +0100
@@ -1,5 +1,7 @@
 2009-12-13  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/generic/gcdext.c (compute_v): Normalize tp[] after mpn_mul.
+
 	* mpz/powm.c: Rework buffer handling.
 
 2009-12-13  Niels Möller  <nisse at lysator.liu.se>
diff -r f3afc6947316 -r 20c811bc3f8f mpn/generic/gcdext.c
--- a/mpn/generic/gcdext.c	Sun Dec 13 16:34:18 2009 +0100
+++ b/mpn/generic/gcdext.c	Sun Dec 13 16:50:36 2009 +0100
@@ -118,6 +118,7 @@
     mpn_mul (tp, up, size, ap, an);
 
   size += an;
+  size -= tp[size - 1] == 0;
 
   ASSERT (gn <= size);
 


More information about the gmp-commit mailing list