diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-09-13 12:57:38 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-09-13 12:57:38 +0000 |
commit | 13ca7de4b4845a24716967b91bac79aa4c94372a (patch) | |
tree | 3de01389a61d2a48d2ddbecbdb72d754dd09f72d /tests | |
parent | c61fd918549dbc362f5bb2a87a2f40cad41c12c3 (diff) | |
download | mpfr-13ca7de4b4845a24716967b91bac79aa4c94372a.tar.gz |
fixed bug in exp(-eps) for rounding toward zero (test was also wrong...)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3844 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/texp.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/texp.c b/tests/texp.c index d398ca2ad..82c0217c3 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -339,12 +339,16 @@ check_special () if (mpfr_cmp_ui_2exp (y, 3, -2)) { printf ("Error for exp(-1/16), prec=2, RNDD\n"); + printf ("expected 0.11, got "); + mpfr_dump (y); exit (1); } test_exp (y, x, GMP_RNDZ); - if (mpfr_cmp_ui (y, 1)) + if (mpfr_cmp_ui_2exp (y, 3, -2)) { printf ("Error for exp(-1/16), prec=2, RNDZ\n"); + printf ("expected 0.11, got "); + mpfr_dump (y); exit (1); } mpfr_set_str_binary (x, "0.1E-3"); @@ -426,6 +430,16 @@ check_special () mpfr_out_str (stdout, 16, 0, x, GMP_RNDN); putchar ('\n'); } + /* bug found by Guillaume Melquiond, 13 Sep 2005 */ + mpfr_set_prec (x, 53); + mpfr_set_str_binary (x, "-1E-400"); + mpfr_exp (x, x, GMP_RNDZ); + if (mpfr_cmp_ui (x, 1) == 0) + { + printf ("Error for exp(-2^(-400))\n"); + exit (1); + } + mpfr_clear (x); mpfr_clear (y); mpfr_clear (z); |