[libc-commits] [libc] [llvm] [libc][math] Implement double precision sinh correctly rounded for all rounding modes. (PR #235097)

via libc-commits libc-commits at lists.llvm.org
Sun Oct 25 19:19:03 PDT 2026


================
@@ -67,6 +67,24 @@ LIBC_INLINE constexpr NumberPair<T> exact_add(T a, T b) {
   return r;
 }
 
+template <bool FAST2SUM = true, typename T = double>
+LIBC_INLINE constexpr NumberPair<T> exact_sub(T a, T b) {
+  NumberPair<T> r{0.0, 0.0};
----------------
lntue wrote:

Good point.  Actually, we already have  the default constructor with `= T(0)` in `NumberPair`, so we don't need to explicitly zero-initialize `r` here.  I also updated `exact_add` and other functions in this file with the same issue.

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


More information about the libc-commits mailing list