diff options
Diffstat (limited to 'cosh.c')
-rw-r--r-- | cosh.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -87,12 +87,13 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) MPFR_ZIV_INIT (loop, Nt); for (;;) { + MPFR_BLOCK_DECL (flags); + /* Compute cosh */ - mpfr_clear_flags (); - mpfr_exp (te, x, GMP_RNDD); /* exp(x) */ + MPFR_BLOCK (flags, mpfr_exp (te, x, GMP_RNDD)); /* exp(x) */ /* exp can overflow (but not underflow since x>0) */ /* BUG/TODO/FIXME: exp can overflow but cosh may be representable! */ - if (MPFR_UNLIKELY (mpfr_overflow_p ())) + if (MPFR_OVERFLOW (flags)) { inexact = mpfr_overflow (y, rnd_mode, MPFR_SIGN_POS); MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, MPFR_FLAGS_OVERFLOW); |