[libc-commits] [libc] Fixed Hypotbf16 build failure (PR #186415)

via libc-commits libc-commits at lists.llvm.org
Fri Mar 13 08:26:00 PDT 2026


https://github.com/Sukumarsawant created https://github.com/llvm/llvm-project/pull/186415

added static_cast 

>From 2ea6ef46ed7bfe8fd5ff0062d10815e7af57ed62 Mon Sep 17 00:00:00 2001
From: Sukumarsawant <sawantsukumar at gmail.com>
Date: Fri, 13 Mar 2026 20:54:02 +0530
Subject: [PATCH] fix: added static_cast

---
 libc/src/__support/FPUtil/Hypot.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/FPUtil/Hypot.h b/libc/src/__support/FPUtil/Hypot.h
index e23f8b52d8220..699d1cab7ba1c 100644
--- a/libc/src/__support/FPUtil/Hypot.h
+++ b/libc/src/__support/FPUtil/Hypot.h
@@ -219,7 +219,7 @@ LIBC_INLINE T hypot(T x, T y) {
   for (StorageType current_bit = leading_one >> 1; current_bit;
        current_bit >>= 1) {
     r = static_cast<StorageType>((r << 1)) +
-        ((tail_bits & current_bit) ? 1 : 0);
+        static_cast<StorageType>((tail_bits & current_bit) ? 1 : 0);
     StorageType tmp = static_cast<StorageType>((y_new << 1)) +
                       current_bit; // 2*y_new(n - 1) + 2^(-n)
     if (r >= tmp) {



More information about the libc-commits mailing list