diff options
author | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2008-02-27 10:00:11 +0000 |
---|---|---|
committer | thevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4> | 2008-02-27 10:00:11 +0000 |
commit | a53b5f84e27622e106289bd7f7369aa87bc4eb10 (patch) | |
tree | 8b91a6e9fe818b627e0f88ad96c5846155c84bd2 /tests | |
parent | 8fe2c805f283628a8de477d734c5284e175ec3b7 (diff) | |
download | mpfr-a53b5f84e27622e106289bd7f7369aa87bc4eb10.tar.gz |
mul_d.c: restore flags set by mpfr_mul. This fixes the bug revealed by MPFR_SUSPICIOUS_OVERFLOW
test/tmul_d.c: add checks for exception flags
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5321 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tmul_d.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/tmul_d.c b/tests/tmul_d.c index 9b403498f..a4a4cdfc5 100644 --- a/tests/tmul_d.c +++ b/tests/tmul_d.c @@ -38,23 +38,27 @@ check_nans (void) /* nan * 1.0 is nan */ mpfr_set_nan (x); + mpfr_clear_flags(); mpfr_mul_d (y, x, 1.0, GMP_RNDN); - MPFR_ASSERTN (mpfr_nan_p (y)); + MPFR_ASSERTN (mpfr_nan_p (y) && mpfr_nanflag_p()); /* +inf * 1.0 == +inf */ mpfr_set_inf (x, 1); + mpfr_clear_flags(); mpfr_mul_d (y, x, 1.0, GMP_RNDN); - MPFR_ASSERTN (mpfr_inf_p (y)); + MPFR_ASSERTN (mpfr_inf_p (y) && !mpfr_overflow_p()); MPFR_ASSERTN (mpfr_sgn (y) > 0); /* +inf * 0.0 is nan */ + mpfr_clear_flags(); mpfr_mul_d (y, x, 0.0, GMP_RNDN); - MPFR_ASSERTN (mpfr_nan_p (y)); + MPFR_ASSERTN (mpfr_nan_p (y) || mpfr_nanflag_p()); /* -inf * 1.0 == -inf */ mpfr_set_inf (x, -1); + mpfr_clear_flags(); mpfr_mul_d (y, x, 1.0, GMP_RNDN); - MPFR_ASSERTN (mpfr_inf_p (y)); + MPFR_ASSERTN (mpfr_inf_p (y) && !mpfr_overflow_p()); MPFR_ASSERTN (mpfr_sgn (y) < 0); mpfr_clear (x); |