summaryrefslogtreecommitdiff
path: root/tests/tconst_log2.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-23 12:48:00 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-11-23 12:48:00 +0000
commit15770b6fff69131cc8176c3df5a9d93abe14796a (patch)
tree1c69446d0f74ccc4c00fb341f390d86855c5cd25 /tests/tconst_log2.c
parent527fd2f0289711eb3b1deac082d8407a8c243e59 (diff)
downloadmpfr-15770b6fff69131cc8176c3df5a9d93abe14796a.tar.gz
Improve tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3111 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tconst_log2.c')
-rw-r--r--tests/tconst_log2.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/tconst_log2.c b/tests/tconst_log2.c
index 119f99a7a..c90ebc209 100644
--- a/tests/tconst_log2.c
+++ b/tests/tconst_log2.c
@@ -31,6 +31,7 @@ check (mp_prec_t p0, mp_prec_t p1)
{
mpfr_t x, y, z;
mp_rnd_t rnd;
+ int dif;
mpfr_init (x);
mpfr_init (y);
@@ -46,16 +47,14 @@ check (mp_prec_t p0, mp_prec_t p1)
rnd = RND_RAND ();
mpfr_const_log2 (x, rnd);
mpfr_set (y, z, rnd);
- if (mpfr_cmp (x, y) && mpfr_can_round (z, mpfr_get_prec(z), GMP_RNDN,
+ if ((dif = mpfr_cmp (x, y))
+ && mpfr_can_round (z, mpfr_get_prec(z), GMP_RNDN,
rnd, p0))
{
- printf ("mpfr_const_log2 fails for prec=%u, rnd=%s\n",
- (unsigned int) p0, mpfr_print_rnd_mode (rnd));
- printf ("expected ");
- mpfr_out_str (stdout, 2, 0, y, GMP_RNDN);
- printf ("\ngot ");
- mpfr_out_str (stdout, 2, 0, x, GMP_RNDN);
- printf ("\n");
+ printf ("mpfr_const_log2 fails for prec=%u, rnd=%s Diff=%d\n",
+ (unsigned int) p0, mpfr_print_rnd_mode (rnd), dif);
+ printf ("expected "), mpfr_dump (y);
+ printf ("got "), mpfr_dump (x);
exit (1);
}
}