summaryrefslogtreecommitdiff
path: root/exp2.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-18 15:51:00 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-18 15:51:00 +0000
commita6043f2d22e376360264317d140406d85c1f3649 (patch)
tree196e725c272f5da0a5843506a28f091ae820e65d /exp2.c
parentbf7ddd19d8dd01f52acc4b5cec744b4a3df96771 (diff)
downloadmpfr-a6043f2d22e376360264317d140406d85c1f3649.tar.gz
Merged the feature-block branch to the trunk:
* New MPFR_BLOCK* macros (see mpfr-impl.h) and mpfrlint check to test exception flags in a more reliable way and detect possible problems with mpfrlint. * Improved the generic tests (tests/tgeneric.c): for the second function call, sometimes set all the flags since risk of failures are known when some flags are already set. * Modified code to use these new MPFR_BLOCK* macros. This fixed bugs related to exceptions (where flags are set before the call); in particular, tcot and ty1 failed with the improved generic tests. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5115 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'exp2.c')
-rw-r--r--exp2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/exp2.c b/exp2.c
index f0dc681f6..e5f67a0c8 100644
--- a/exp2.c
+++ b/exp2.c
@@ -138,8 +138,10 @@ mpfr_exp2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
mpfr_clear (xfrac);
mpfr_clear_flags ();
mpfr_mul_2si (y, y, xint, GMP_RNDN); /* exact or overflow */
- /* Note: We can have an overflow only when t was rounded up to 2. */
- MPFR_ASSERTD (!mpfr_overflow_p () || inexact > 0);
+ /* Note: We can have an overflow only when t was rounded up to 2.
+ We do not check the overflow flag as it could have already been
+ set before the call to mpfr_exp2. */
+ MPFR_ASSERTD (MPFR_IS_PURE_FP (y) || inexact > 0);
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);