[libc-commits] [libc] [libc][math][c23] Add exp2m1f C23 math function (PR #86996)
via libc-commits
libc-commits at lists.llvm.org
Mon Apr 1 13:41:55 PDT 2024
================
@@ -223,6 +229,30 @@ class MPFRNumber {
return result;
}
+ MPFRNumber
+ exp2m1([[maybe_unused]] const MPFRNumber &underflow_rndz_fallback) const {
+ // TODO: Only use mpfr_exp2m1 once CI and buildbots get MPFR >= 4.2.0.
+#if MPFR_VERSION_MAJOR > 4 || \
+ (MPFR_VERSION_MAJOR == 4 && MPFR_VERSION_MINOR >= 2)
+ MPFRNumber result(*this);
+ mpfr_exp2m1(result.value, value, mpfr_rounding);
+ return result;
+#else
+ MPFRNumber result(*this, mpfr_precision * 8);
----------------
lntue wrote:
Do you have examples that failed with `mpfr_precision * 7`?
https://github.com/llvm/llvm-project/pull/86996
More information about the libc-commits
mailing list