[Gmp-commit] /var/hg/gmp: tests/mpz/t-root.c: Only powers of small numbers...

mercurial at gmplib.org mercurial at gmplib.org
Wed Jun 10 21:42:43 UTC 2015


details:   /var/hg/gmp/rev/6fc5b81e601d
changeset: 16698:6fc5b81e601d
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Wed Jun 10 23:42:36 2015 +0200
description:
tests/mpz/t-root.c: Only powers of small numbers...

diffstat:

 tests/mpz/t-root.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 343444ab162a -r 6fc5b81e601d tests/mpz/t-root.c
--- a/tests/mpz/t-root.c	Wed Jun 10 01:03:22 2015 +0200
+++ b/tests/mpz/t-root.c	Wed Jun 10 23:42:36 2015 +0200
@@ -132,6 +132,8 @@
       mpz_urandomb (bs, rands, 15);
       nth = mpz_getlimbn (bs, 0) % mpz_sizeinbase (x2, 2) + 2;
 
+      res = mpz_root (root1, x2, nth);
+
       mpz_urandomb (bs, rands, 4);
       bsi = mpz_get_ui (bs);
       if ((bsi & 1) != 0)
@@ -145,9 +147,9 @@
 	    }
 	  else
 	    mpz_add_ui (x2, x2, bsi >> 2);
+	  res = mpz_root (root1, x2, nth);
 	}
 
-      res = mpz_root (root1, x2, nth);
       check_one (root1, x2, nth, res, i);
 
       if (((nth & 1) != 0) && ((bsi & 2) != 0))


More information about the gmp-commit mailing list