[libc-commits] [libc] [libc][math] Update getpayload and fmul with NaN inputs. (PR #99812)

via libc-commits libc-commits at lists.llvm.org
Sun Jul 21 16:09:22 PDT 2024


================
@@ -274,7 +274,10 @@ LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, T> getpayload(T x) {
   if (!x_bits.is_nan())
     return T(-1.0);
 
-  return T(x_bits.uintval() & (FPBits::FRACTION_MASK >> 1));
+  DyadicFloat<FPBits::STORAGE_LEN> payload(
+      Sign::POS, 0, x_bits.uintval() & (FPBits::FRACTION_MASK >> 1));
+
+  return static_cast<T>(payload);
----------------
lntue wrote:

fixed.

https://github.com/llvm/llvm-project/pull/99812


More information about the libc-commits mailing list