[libc-commits] [libc] [libc] Refactor llogbl to be header-only and constexpr (PR #175376)

via libc-commits libc-commits at lists.llvm.org
Sun Jan 11 10:38:34 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- libc/src/math/generic/llogbl.cpp libc/src/math/llogbl.h libc/test/src/math/smoke/llogbl_test.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/math/llogbl.h b/libc/src/math/llogbl.h
index 4a45eb6f1..2cd22d4ca 100644
--- a/libc/src/math/llogbl.h
+++ b/libc/src/math/llogbl.h
@@ -15,8 +15,9 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-// Inline constexpr implementation: extract the unbiased exponent of a long double
-// by delegating to the existing constexpr template fputil::intlogb<long>.
+// Inline constexpr implementation: extract the unbiased exponent of a long
+// double by delegating to the existing constexpr template
+// fputil::intlogb<long>.
 LIBC_INLINE constexpr long llogbl(long double x) {
   return fputil::intlogb<long>(x);
 }

``````````

</details>


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


More information about the libc-commits mailing list