From a53b5f84e27622e106289bd7f7369aa87bc4eb10 Mon Sep 17 00:00:00 2001 From: thevenyp Date: Wed, 27 Feb 2008 10:00:11 +0000 Subject: 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 --- tests/tmul_d.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/tmul_d.c') 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); -- cgit v1.2.1