[libc-commits] [libc] e6afe2a - [libc] Fix temporary types for fputil::split template. (#163813)

via libc-commits libc-commits at lists.llvm.org
Thu Oct 16 09:56:13 PDT 2025


Author: lntue
Date: 2025-10-16T12:56:09-04:00
New Revision: e6afe2a85471ee0b2463428ee3fc0411e25237cc

URL: https://github.com/llvm/llvm-project/commit/e6afe2a85471ee0b2463428ee3fc0411e25237cc
DIFF: https://github.com/llvm/llvm-project/commit/e6afe2a85471ee0b2463428ee3fc0411e25237cc.diff

LOG: [libc] Fix temporary types for fputil::split template. (#163813)

Fix #163711.

Added: 
    

Modified: 
    libc/src/__support/FPUtil/double_double.h

Removed: 
    


################################################################################
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;


        


More information about the libc-commits mailing list