summaryrefslogtreecommitdiff
path: root/tests/tconst_pi.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-13 10:52:11 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-13 10:52:11 +0000
commit69febd2bb6843718a242f0ac95468822bd47e104 (patch)
tree5bfdcbb9ea1f1af7fbe5071ca0428e820da84c10 /tests/tconst_pi.c
parent9c513acbcdebb3d687fadad3739a4eb5ceea71d2 (diff)
downloadmpfr-69febd2bb6843718a242f0ac95468822bd47e104.tar.gz
improved coverage
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2700 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tconst_pi.c')
-rw-r--r--tests/tconst_pi.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/tconst_pi.c b/tests/tconst_pi.c
index ea9884d61..33f9f3400 100644
--- a/tests/tconst_pi.c
+++ b/tests/tconst_pi.c
@@ -27,20 +27,27 @@ MA 02111-1307, USA. */
/* tconst_pi [prec] [rnd] [0 = no print] */
static void
-check_large(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))
+
+ 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);
+ printf ("const_pi: error for large prec\n");
+ exit (1);
}
- mpfr_clears(x,y,NULL);
+
+ /* a worst-case to exercise recomputation */
+ mpfr_set_prec (x, 33440);
+ mpfr_const_pi (x, GMP_RNDZ);
+
+ mpfr_clears (x, y, NULL);
}
int