diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-03-02 13:54:18 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-03-02 13:54:18 +0000 |
commit | d5a7537cc55520f79457cffc026f8708386f1a50 (patch) | |
tree | ccb3f3ec79128d38fe9b5faff88914662fdeba29 | |
parent | d91a1235e75bd390478427e0d1ddd746f7a529b6 (diff) | |
download | mpfr-d5a7537cc55520f79457cffc026f8708386f1a50.tar.gz |
[src/agm.c] Check internal exceptions: the error analysis may be
incorrect in case of exception.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7509 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/agm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -196,6 +196,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) op2 = sc2; goto retry; } + mpfr_clear_flags (); mpfr_sqrt (u, u, MPFR_RNDN); mpfr_div_2ui (v, v, 1, MPFR_RNDN); n = 1; @@ -238,6 +239,9 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) } MPFR_ZIV_FREE (loop); + MPFR_ASSERTN (! (mpfr_overflow_p () || mpfr_underflow_p () || + mpfr_divby0_p () || mpfr_nanflag_p ())); + /* Setting of the result */ inexact = mpfr_set (r, v, rnd_mode); if (scale != 0) |