summaryrefslogtreecommitdiff
path: root/tests/tconst_pi.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-12 14:20:43 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-12 14:20:43 +0000
commitf0184cf71b820239d92f1e18558f550e7dbcbd6a (patch)
tree19013678eb4517b761d9352669d76687a0e673b3 /tests/tconst_pi.c
parent51fb1e401b56e9ea37f7af4f17dc5293f5acdd24 (diff)
downloadmpfr-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_pi.c')
-rw-r--r--tests/tconst_pi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c
index 76975993e..ea9884d61 100644
--- a/tests/tconst_pi.c
+++ b/tests/tconst_pi.c
@@ -26,6 +26,23 @@ MA 02111-1307, USA. */
/* tconst_pi [prec] [rnd] [0 = no print] */
+static void
+check_large(void)
+{
+ mpfr_t x, y;
+ mpfr_init2(x, 20000);
+ mpfr_init2(y, 21000);
+ mpfr_const_pi(x, GMP_RNDN); /* First one ! */
+ mpfr_const_pi(y, GMP_RNDN); /* Then the other - cache - */
+ mpfr_prec_round(y, 20000, 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[])
{
@@ -72,6 +89,8 @@ main (int argc, char *argv[])
mpfr_clear (x);
+ check_large();
+
tests_end_mpfr ();
return 0;
}