diff options
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/atan2.c')
-rw-r--r-- | Build/source/libs/mpfr/mpfr-src/src/atan2.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/atan2.c b/Build/source/libs/mpfr/mpfr-src/src/atan2.c index 41d49f25068..57bc14f798e 100644 --- a/Build/source/libs/mpfr/mpfr-src/src/atan2.c +++ b/Build/source/libs/mpfr/mpfr-src/src/atan2.c @@ -130,9 +130,8 @@ mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_const_pi (tmp2, MPFR_RNDN); mpfr_mul_ui (tmp2, tmp2, 3, MPFR_RNDN); /* Error <= 2 */ mpfr_div_2ui (tmp2, tmp2, 2, MPFR_RNDN); - if (mpfr_round_p (MPFR_MANT (tmp2), MPFR_LIMB_SIZE (tmp2), - MPFR_PREC (tmp2) - 2, - MPFR_PREC (dest) + (rnd_mode == MPFR_RNDN))) + if (MPFR_CAN_ROUND (tmp2, MPFR_PREC (tmp2) - 2, + MPFR_PREC (dest), rnd_mode)) break; MPFR_ZIV_NEXT (loop2, prec2); mpfr_set_prec (tmp2, prec2); @@ -155,11 +154,11 @@ mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) /* When x is a power of two, we call directly atan(y/x) since y/x is exact. */ - if (MPFR_UNLIKELY (MPFR_IS_POWER_OF_2 (x))) + if (MPFR_UNLIKELY (MPFR_IS_POS (x) && mpfr_powerof2_raw (x))) { int r; mpfr_t yoverx; - unsigned int saved_flags = __gmpfr_flags; + mpfr_flags_t saved_flags = __gmpfr_flags; mpfr_init2 (yoverx, MPFR_PREC (y)); if (MPFR_LIKELY (mpfr_div_2si (yoverx, y, MPFR_GET_EXP (x) - 1, |