summaryrefslogtreecommitdiff
path: root/tests/mpz/t-root.c
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2009-05-09 22:02:39 +0200
committerTorbjorn Granlund <tege@gmplib.org>2009-05-09 22:02:39 +0200
commit294e9ec0c1106924aa37c049019f7fb3e2ffc803 (patch)
tree2ccec40a911429cc19a4440e75aacb0111920cc8 /tests/mpz/t-root.c
parent0c4f76ba0680251d8be5251baae07434523521f0 (diff)
downloadgmp-294e9ec0c1106924aa37c049019f7fb3e2ffc803.tar.gz
Invoke GMP_CHECK_FORMAT for many results.
Diffstat (limited to 'tests/mpz/t-root.c')
-rw-r--r--tests/mpz/t-root.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/mpz/t-root.c b/tests/mpz/t-root.c
index 86af70e59..22fd31c7f 100644
--- a/tests/mpz/t-root.c
+++ b/tests/mpz/t-root.c
@@ -37,8 +37,15 @@ check_one (mpz_t root1, mpz_t x2, unsigned long nth, int i)
mpz_init (temp);
mpz_init (temp2);
+ MPZ_CHECK_FORMAT (root1);
+
mpz_rootrem (root2, rem2, x2, nth);
+ MPZ_CHECK_FORMAT (root2);
+ MPZ_CHECK_FORMAT (rem2);
+
mpz_pow_ui (temp, root1, nth);
+ MPZ_CHECK_FORMAT (temp);
+
mpz_add (temp2, temp, rem2);
/* Is power of result > argument? */
@@ -65,6 +72,7 @@ check_one (mpz_t root1, mpz_t x2, unsigned long nth, int i)
{
mpz_add_ui (temp2, root1, 1L);
mpz_pow_ui (temp2, temp2, nth);
+ MPZ_CHECK_FORMAT (temp2);
/* Is square of (result + 1) <= argument? */
if (mpz_cmp (temp2, x2) <= 0)