[Gmp-commit] /var/hg/gmp: Fixed comment and assert regarding q and n overlap.

mercurial at gmplib.org mercurial at gmplib.org
Sat Mar 19 09:10:48 CET 2011


details:   /var/hg/gmp/rev/798bd4a2cc41
changeset: 14067:798bd4a2cc41
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Sat Mar 19 09:10:43 2011 +0100
description:
Fixed comment and assert regarding q and n overlap.

diffstat:

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

diffs (33 lines):

diff -r 3127bba7037a -r 798bd4a2cc41 ChangeLog
--- a/ChangeLog	Wed Mar 16 19:55:13 2011 +0100
+++ b/ChangeLog	Sat Mar 19 09:10:43 2011 +0100
@@ -1,3 +1,8 @@
+2011-03-19  Niels Möller  <nisse at lysator.liu.se>
+
+	* mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
+	regarding q and n overlap.
+
 2011-03-16  Marc Glisse  <marc.glisse at inria.fr>
 
 	* gmpxx.h (__mpz_set_ui_safe): New inline function.
diff -r 3127bba7037a -r 798bd4a2cc41 mpn/generic/divrem_2.c
--- a/mpn/generic/divrem_2.c	Wed Mar 16 19:55:13 2011 +0100
+++ b/mpn/generic/divrem_2.c	Sat Mar 19 09:10:43 2011 +0100
@@ -39,7 +39,7 @@
    Preconditions:
    1. The most significant bit of the divisor must be set.
    2. qp must either not overlap with the input operands at all, or
-      qp + 2 >= np must hold true.  (This means that it's possible to put
+      qp >= np + 2 must hold true.  (This means that it's possible to put
       the quotient in the high part of {np,nn}, right above the remainder.
    3. nn >= 2, even if qxn is non-zero.  */
 
@@ -56,7 +56,7 @@
   ASSERT (nn >= 2);
   ASSERT (qxn >= 0);
   ASSERT (dp[1] & GMP_NUMB_HIGHBIT);
-  ASSERT (! MPN_OVERLAP_P (qp, nn-2+qxn, np, nn) || qp+2 >= np);
+  ASSERT (! MPN_OVERLAP_P (qp, nn-2+qxn, np, nn) || qp >= np+2);
   ASSERT_MPN (np, nn);
   ASSERT_MPN (dp, 2);
 


More information about the gmp-commit mailing list