diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-05-04 12:52:01 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-05-04 12:52:01 +0000 |
commit | a9b7e5b01552f5d6aa8ec695381dce823502cdd8 (patch) | |
tree | 3d683177b95cfaa02f8ec21d69815f63a96b72c3 /tests/tlog.c | |
parent | 5342b7eee76afe3bb86aba6b1bc5af32008679c2 (diff) | |
download | mpfr-a9b7e5b01552f5d6aa8ec695381dce823502cdd8.tar.gz |
Add a test to check an overflow in const_pi (called by log in case of emulation of the float type).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2892 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tlog.c')
-rw-r--r-- | tests/tlog.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tlog.c b/tests/tlog.c index 517c66c33..dbcede009 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -157,6 +157,17 @@ special (void) mpfr_init2 (x, 53); mpfr_init2 (y, 53); + + /* Check special case: An overflow in const_pi could occurs! */ + mpfr_set_emin (-125); + mpfr_set_emax (128); + mpfr_set_prec (y, 24*2); + mpfr_set_prec (x, 24); + mpfr_set_str_binary (x, "0.111110101010101011110101E0"); + mpfr_log (y, x, GMP_RNDN); + mpfr_set_emin (MPFR_EMIN_MIN); + mpfr_set_emax (MPFR_EMAX_MAX); + mpfr_set_ui (x, 3, GMP_RNDD); mpfr_log (y, x, GMP_RNDD); if (mpfr_cmp_str1 (y, "1.09861228866810956")) |