[libc-commits] [libc] [libc] Fix temporary types for fputil::split template. (PR #163813)
via libc-commits
libc-commits at lists.llvm.org
Thu Oct 16 09:12:00 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: None (lntue)
<details>
<summary>Changes</summary>
Fix #<!-- -->163711.
---
Full diff: https://github.com/llvm/llvm-project/pull/163813.diff
1 Files Affected:
- (modified) libc/src/__support/FPUtil/double_double.h (+3-3)
``````````diff
diff --git a/libc/src/__support/FPUtil/double_double.h b/libc/src/__support/FPUtil/double_double.h
index 8e54e845de493..9affced3d2cee 100644
--- a/libc/src/__support/FPUtil/double_double.h
+++ b/libc/src/__support/FPUtil/double_double.h
@@ -77,9 +77,9 @@ LIBC_INLINE constexpr NumberPair<T> split(T a) {
NumberPair<T> r{0.0, 0.0};
// CN = 2^N.
constexpr T CN = static_cast<T>(1 << N);
- constexpr T C = CN + 1.0;
- double t1 = C * a;
- double t2 = a - t1;
+ constexpr T C = CN + T(1);
+ T t1 = C * a;
+ T t2 = a - t1;
r.hi = t1 + t2;
r.lo = a - r.hi;
return r;
``````````
</details>
https://github.com/llvm/llvm-project/pull/163813
More information about the libc-commits
mailing list