[Gmp-commit] /home/hgfiles/gmp: Fixed asserts.

mercurial at gmplib.org mercurial at gmplib.org
Fri Dec 18 11:41:47 CET 2009


details:   /home/hgfiles/gmp/rev/1c1ae1bee11d
changeset: 13123:1c1ae1bee11d
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Fri Dec 18 11:41:41 2009 +0100
description:
Fixed asserts.

diffstat:

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

diffs (26 lines):

diff -r ee68cd3aa4d3 -r 1c1ae1bee11d ChangeLog
--- a/ChangeLog	Fri Dec 18 08:32:05 2009 +0100
+++ b/ChangeLog	Fri Dec 18 11:41:41 2009 +0100
@@ -1,3 +1,8 @@
+2009-12-18  Niels Möller  <nisse at lysator.liu.se>
+
+	* mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
+	output asserts.
+
 2009-12-18  Torbjorn Granlund  <tege at gmplib.org>
 
 	* tests/mpn/t-toom63.c: New test program.
diff -r ee68cd3aa4d3 -r 1c1ae1bee11d mpn/generic/toom_eval_pm2exp.c
--- a/mpn/generic/toom_eval_pm2exp.c	Fri Dec 18 08:32:05 2009 +0100
+++ b/mpn/generic/toom_eval_pm2exp.c	Fri Dec 18 11:41:41 2009 +0100
@@ -106,8 +106,8 @@
   mpn_add_n (xp2, xp2, tp, n + 1);
 #endif /* !HAVE_NATIVE_mpn_add_n_sub_n */
 
-  ASSERT (xp2[n] < (1<<(k+1))-1);
-  ASSERT (xm2[n] < ((1<<(k+2))-1 - (k & 1))/3);
+  ASSERT (xp2[n] < ((1<<((k+1)*shift))-1)/((1<<shift)-1));
+  ASSERT (xm2[n] < ((1<<((k+2)*shift))-((k&1)?(1<<shift):1))/((1<<(2*shift))-1));
 
   return neg;
 }


More information about the gmp-commit mailing list