diff options
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/agm.c')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/agm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/agm.c b/Build/source/libs/mpfr/mpfr-src/src/agm.c index 4e13fb3faa5..bef101c52df 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/agm.c +++ b/Build/source/libs/mpfr/mpfr-src/src/agm.c @@ -72,7 +72,10 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) } } else /* a and b are neither NaN nor Inf, and one is zero */ - { /* If a or b is 0, the result is +0 since a sqrt is positive */ + { /* If a or b is 0, the result is +0, in particular because the + result is always >= 0 with our definition (Maple sometimes + chooses a different sign for GaussAGM, but it uses another + definition, with possible negative results). */ MPFR_ASSERTD (MPFR_IS_ZERO (op1) || MPFR_IS_ZERO (op2)); MPFR_SET_POS (r); MPFR_SET_ZERO (r); @@ -201,7 +204,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) goto retry; } - mpfr_clear_flags (); + MPFR_CLEAR_FLAGS (); mpfr_sqrt (u, u, MPFR_RNDN); mpfr_div_2ui (v, v, 1, MPFR_RNDN); @@ -245,7 +248,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) method. */ MPFR_LOG_MSG (("4*eq > p -> underflow\n", 0)); mpfr_clear (w); - mpfr_clear_underflow (); + MPFR_CLEAR_UNDERFLOW (); } /* U(k) increases, so that U.V can overflow (but not underflow). */ MPFR_BLOCK (flags2, mpfr_mul (uf, u, v, MPFR_RNDN);); @@ -261,7 +264,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) MPFR_LOG_MSG (("Overflow in iteration n = %lu, scaleit = %" MPFR_EXP_FSPEC "d (%" MPFR_EXP_FSPEC "d)\n", n, scaleit, scale2)); - mpfr_clear_overflow (); + MPFR_CLEAR_OVERFLOW (); goto retry2; } mpfr_sqrt (u, uf, MPFR_RNDN); |