[Gmp-commit] /var/hg/gmp: mini-gmp/mini-gmp.c (mpn_sqrtrem): add an assert().

mercurial at gmplib.org mercurial at gmplib.org
Sat Feb 22 19:40:01 UTC 2014


details:   /var/hg/gmp/rev/a3887ee0a9ab
changeset: 16312:a3887ee0a9ab
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Feb 22 20:39:55 2014 +0100
description:
mini-gmp/mini-gmp.c (mpn_sqrtrem): add an assert().

diffstat:

 mini-gmp/mini-gmp.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 45bd52435e58 -r a3887ee0a9ab mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Fri Feb 21 19:32:38 2014 +0100
+++ b/mini-gmp/mini-gmp.c	Sat Feb 22 20:39:55 2014 +0100
@@ -3298,6 +3298,8 @@
   mpz_init (r);
   mpz_init (s);
   mpz_rootrem (s, r, mpz_roinit_n (u, p, n), 2);
+
+  assert (s->_mp_size == (n+1)/2);
   mpn_copyd (sp, s->_mp_d, s->_mp_size);
   mpz_clear (s);
   res = r->_mp_size;


More information about the gmp-commit mailing list