summaryrefslogtreecommitdiff
path: root/cosh.c
diff options
context:
space:
mode:
Diffstat (limited to 'cosh.c')
-rw-r--r--cosh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cosh.c b/cosh.c
index 3c45c09f6..6a2b06564 100644
--- a/cosh.c
+++ b/cosh.c
@@ -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);