[libc-commits] [libc] [libc] Use `raise_except_if_required` for log2f. (PR #144961)

via libc-commits libc-commits at lists.llvm.org
Thu Jun 19 14:44:50 PDT 2025


https://github.com/lntue created https://github.com/llvm/llvm-project/pull/144961

None

>From 857d9aedbe8b16683bad2b41e2c55245b52e0ee2 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Thu, 19 Jun 2025 21:43:45 +0000
Subject: [PATCH] [libc] Use `raise_except_if_required` for log2f.

---
 libc/src/math/generic/log2f.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/math/generic/log2f.cpp b/libc/src/math/generic/log2f.cpp
index b25ec41f277b6..cff718eec2169 100644
--- a/libc/src/math/generic/log2f.cpp
+++ b/libc/src/math/generic/log2f.cpp
@@ -79,7 +79,7 @@ LLVM_LIBC_FUNCTION(float, log2f, (float x)) {
     }
     if (xbits.is_neg() && !xbits.is_nan()) {
       fputil::set_errno_if_required(EDOM);
-      fputil::raise_except(FE_INVALID);
+      fputil::raise_except_if_required(FE_INVALID);
       return FPBits::quiet_nan().get_val();
     }
     if (xbits.is_inf_or_nan()) {



More information about the libc-commits mailing list