summaryrefslogtreecommitdiff
path: root/atan.c
diff options
context:
space:
mode:
Diffstat (limited to 'atan.c')
-rw-r--r--atan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/atan.c b/atan.c
index 3e5b44fe1..ecb2bdf71 100644
--- a/atan.c
+++ b/atan.c
@@ -142,6 +142,8 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode)
else
supplement = 2 - MPFR_GET_EXP (xp);
+ mpfr_save_emin_emax ();
+
prec_x = __gmpfr_ceil_log2 ((double) MPFR_PREC(x) / BITS_PER_MP_LIMB);
logn = __gmpfr_ceil_log2 ((double) prec_x);
if (logn < 2)
@@ -256,5 +258,6 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode)
mpz_clear (ukz);
mpz_clear (square);
- return inexact;
+ mpfr_restore_emin_emax ();
+ return mpfr_check_range (arctgt, inexact, rnd_mode);
}