diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-12 14:20:43 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-02-12 14:20:43 +0000 |
commit | f0184cf71b820239d92f1e18558f550e7dbcbd6a (patch) | |
tree | 19013678eb4517b761d9352669d76687a0e673b3 /tests/tconst_log2.c | |
parent | 51fb1e401b56e9ea37f7af4f17dc5293f5acdd24 (diff) | |
download | mpfr-f0184cf71b820239d92f1e18558f550e7dbcbd6a.tar.gz |
Improve coverage of const_pi and const_log2 (Test for prec > 20000).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2688 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tconst_log2.c')
-rw-r--r-- | tests/tconst_log2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c index df5b7c1e8..77a2f5377 100644 --- a/tests/tconst_log2.c +++ b/tests/tconst_log2.c @@ -66,6 +66,23 @@ check (mp_prec_t p0, mp_prec_t p1) mpfr_clear (z); } +static void +check_large(void) +{ + mpfr_t x, y; + mpfr_init2(x, 25000); + mpfr_init2(y, 26000); + mpfr_const_log2(x, GMP_RNDN); /* First one ! */ + mpfr_const_log2(y, GMP_RNDN); /* Then the other - cache - */ + mpfr_prec_round(y, 25000, GMP_RNDN); + if (mpfr_cmp(x,y)) + { + printf("const_pi: error for large prec\n"); + exit(1); + } + mpfr_clears(x,y,NULL); +} + int main (int argc, char *argv[]) { @@ -121,6 +138,8 @@ main (int argc, char *argv[]) mpfr_clear(x); + check_large(); + tests_end_mpfr (); return 0; } |