From d71cf99ec93271eb23df466b55240249324359a3 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Sun, 14 Sep 2003 08:52:44 +0000 Subject: Fixed mpfr_set_overflow, added tests for mpfr_set_underflow and mpfr_set_overflow, and reverted exp.c. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2411 280ebfd0-de03-0410-8827-d642c229c3f4 --- exceptions.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'exceptions.c') diff --git a/exceptions.c b/exceptions.c index db62a01ee..ca3172a00 100644 --- a/exceptions.c +++ b/exceptions.c @@ -218,16 +218,17 @@ mpfr_set_overflow (mpfr_ptr x, mp_rnd_t rnd_mode, int sign) int inex; MPFR_CLEAR_FLAGS(x); - if ((rnd_mode == GMP_RNDU && sign < 0) - || (rnd_mode == GMP_RNDD && sign > 0)) + if (rnd_mode == GMP_RNDN + || (rnd_mode == GMP_RNDU && sign > 0) + || (rnd_mode == GMP_RNDD && sign < 0)) { - mpfr_setmax (x, __gmpfr_emax); - inex = -1; + MPFR_SET_INF(x); + inex = 1; } else { - MPFR_SET_INF(x); - inex = 1; + mpfr_setmax (x, __gmpfr_emax); + inex = -1; } if (MPFR_SIGN(x) != sign) MPFR_CHANGE_SIGN(x); -- cgit v1.2.1