summaryrefslogtreecommitdiff
path: root/src/mpfr-impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mpfr-impl.h')
-rw-r--r--src/mpfr-impl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h
index dcc586487..c98f6ab38 100644
--- a/src/mpfr-impl.h
+++ b/src/mpfr-impl.h
@@ -2594,6 +2594,12 @@ __MPFR_DECLSPEC mpfr_exp_t mpfr_ubf_diff_exp (mpfr_srcptr, mpfr_srcptr);
((void) (x)->_mpfr_exp, \
((mpfr_ubf_ptr) (x))->_mpfr_zexp)
+/* Like MPFR_GET_EXP, but accepts UBF (with exponent saturated to
+ the interval [MPFR_EXP_MIN,MPFR_EXP_MAX]). */
+#define MPFR_UBF_GET_EXP(x) \
+ (MPFR_IS_UBF (x) ? mpfr_ubf_zexp2exp (MPFR_ZEXP (x)) : \
+ MPFR_GET_EXP ((mpfr_ptr) (x)))
+
/* If x is a UBF, clear its mpz_t exponent. */
#define MPFR_UBF_CLEAR_EXP(x) \
((void) (MPFR_IS_UBF (x) && (mpz_clear (MPFR_ZEXP (x)), 0)))