diff options
Diffstat (limited to 'sinh_cosh.c')
-rw-r--r-- | sinh_cosh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sinh_cosh.c b/sinh_cosh.c index 633cc4f00..4886efc05 100644 --- a/sinh_cosh.c +++ b/sinh_cosh.c @@ -91,13 +91,14 @@ mpfr_sinh_cosh (mpfr_ptr sh, mpfr_ptr ch, mpfr_srcptr xt, mp_rnd_t rnd_mode) MPFR_ZIV_INIT (loop, N); for (;;) { + MPFR_BLOCK_DECL (flags); + /* compute sinh_cosh */ - mpfr_clear_flags (); - mpfr_exp (s, x, GMP_RNDD); /* exp(x) */ + MPFR_BLOCK (flags, mpfr_exp (s, x, GMP_RNDD)); /* exp(x) can overflow! */ /* BUG/TODO/FIXME: exp can overflow but sinh or cosh may be representable! */ - if (MPFR_UNLIKELY (mpfr_overflow_p ())) + if (MPFR_OVERFLOW (flags)) { inexact_ch = mpfr_overflow (ch, rnd_mode, MPFR_SIGN_POS); inexact_sh = mpfr_overflow (sh, rnd_mode, MPFR_SIGN (xt)); |