[libc-commits] [libc] [libc][C23][math] Implement cospif function correctly rounded for all rounding modes (PR #97464)
via libc-commits
libc-commits at lists.llvm.org
Fri Jul 5 03:54:51 PDT 2024
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 717d839be4e36ab5330e60d61e0e1265c233b2ea 9a019b96bbd8ef88fdeef2a9a99259f4b7c7d950 -- libc/src/math/cospif.h libc/src/math/generic/cospif.cpp libc/test/src/math/cospif_test.cpp libc/test/src/math/exhaustive/cospif_test.cpp libc/test/src/math/smoke/cospif_test.cpp libc/src/math/generic/sinpif.cpp libc/utils/MPFRWrapper/MPFRUtils.cpp libc/utils/MPFRWrapper/MPFRUtils.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/math/generic/cospif.cpp b/libc/src/math/generic/cospif.cpp
index b04e10fcc4..4f7ded7dee 100644
--- a/libc/src/math/generic/cospif.cpp
+++ b/libc/src/math/generic/cospif.cpp
@@ -83,7 +83,7 @@ LLVM_LIBC_FUNCTION(float, cospif, (float x)) {
double sin_k, cos_k, sin_y, cosm1_y;
sincospif_eval(xd, sin_k, cos_k, sin_y, cosm1_y);
-
+
if (LIBC_UNLIKELY(sin_y == 0 && cos_k == 0))
return FPBits::zero(xbits.sign()).get_val();
``````````
</details>
https://github.com/llvm/llvm-project/pull/97464
More information about the libc-commits
mailing list