[Gmp-commit] /var/hg/gmp: Add ASSERT for inverse correctness.

mercurial at gmplib.org mercurial at gmplib.org
Wed Aug 2 20:35:48 UTC 2017


details:   /var/hg/gmp/rev/82a9fff89363
changeset: 17482:82a9fff89363
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Mon Jul 24 22:20:16 2017 +0200
description:
Add ASSERT for inverse correctness.

diffstat:

 mpn/generic/sbpi1_bdiv_q.c  |  1 +
 mpn/generic/sbpi1_bdiv_qr.c |  1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r e12a84fa9cdf -r 82a9fff89363 mpn/generic/sbpi1_bdiv_q.c
--- a/mpn/generic/sbpi1_bdiv_q.c	Mon Jul 24 12:53:57 2017 +0200
+++ b/mpn/generic/sbpi1_bdiv_q.c	Mon Jul 24 22:20:16 2017 +0200
@@ -55,6 +55,7 @@
   ASSERT (dn > 0);
   ASSERT (un >= dn);
   ASSERT ((dp[0] & 1) != 0);
+  ASSERT ((dp[0] * dinv) == 0);
   ASSERT (up == qp || !MPN_OVERLAP_P (up, un, qp, un - dn));
 
   if (un > dn)
diff -r e12a84fa9cdf -r 82a9fff89363 mpn/generic/sbpi1_bdiv_qr.c
--- a/mpn/generic/sbpi1_bdiv_qr.c	Mon Jul 24 12:53:57 2017 +0200
+++ b/mpn/generic/sbpi1_bdiv_qr.c	Mon Jul 24 22:20:16 2017 +0200
@@ -61,6 +61,7 @@
   ASSERT (dn > 0);
   ASSERT (un > dn);
   ASSERT ((dp[0] & 1) != 0);
+  ASSERT ((dp[0] * dinv) == 0);
   ASSERT (up == qp || !MPN_OVERLAP_P (up, un, qp, un - dn));
 
   for (i = un - dn, cy = 0; i != 0; i--)


More information about the gmp-commit mailing list