diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-05-06 12:37:21 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-05-06 12:37:21 +0000 |
commit | 192543932ca7ce494da0f1956475996bdd09e107 (patch) | |
tree | f18814d29b14a45058def73e1f97a2dcba103d9f /tests/tasin.c | |
parent | 4a3ec96bc477f258f2fab8bac31a7ec5059b09ce (diff) | |
download | mpfr-192543932ca7ce494da0f1956475996bdd09e107.tar.gz |
Fix overflow and add corresponding tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2908 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tasin.c')
-rw-r--r-- | tests/tasin.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/tasin.c b/tests/tasin.c index 12f5037d8..12bdaf579 100644 --- a/tests/tasin.c +++ b/tests/tasin.c @@ -152,12 +152,37 @@ special (void) mpfr_clear (y); } +static void +special_overflow (void) +{ + mpfr_t x, y; + + mpfr_set_emin (-125); + mpfr_set_emax (128); + mpfr_init2 (x, 24); + mpfr_init2 (y, 48); + mpfr_set_str_binary (x, "0.101100100000000000110100E0"); + mpfr_asin (y, x, GMP_RNDN); + if (mpfr_cmp_str (y, "0.110001001101001111110000010110001000111011001000E0", + 2, GMP_RNDN)) + { + printf("Special Overflow error.\n"); + mpfr_dump (y); + exit (1); + } + mpfr_clear (y); + mpfr_clear (x); + mpfr_set_emin (MPFR_EMIN_MIN); + mpfr_set_emax (MPFR_EMAX_MAX); +} + int main (void) { tests_start_mpfr (); special (); + special_overflow (); test_generic (2, 100, 7); |