[libc-commits] [libc] [libc][complex] Add cargf and carg functions to libc complex math (PR #204087)

via libc-commits libc-commits at lists.llvm.org
Tue Jun 16 01:47:23 PDT 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 cpp,h -- libc/src/complex/carg.h libc/src/complex/cargf.h libc/src/complex/generic/carg.cpp libc/src/complex/generic/cargf.cpp libc/test/src/complex/CArgTest.h libc/test/src/complex/carg_test.cpp libc/test/src/complex/cargf_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/test/src/complex/CArgTest.h b/libc/test/src/complex/CArgTest.h
index 890b3f280..9a8d87e1d 100644
--- a/libc/test/src/complex/CArgTest.h
+++ b/libc/test/src/complex/CArgTest.h
@@ -47,7 +47,7 @@ public:
     EXPECT_FP_EQ(FPT(M_PI), func(CFPT{neg_inf, 1.0}));
     EXPECT_FP_EQ(FPT(M_PI), func(CFPT{neg_inf, 64.0}));
     // carg(-inf - yi) = -pi for finite y > 0
-    EXPECT_FP_EQ(FPT(-M_PI), func(CFPT{neg_inf,-1.0}));
+    EXPECT_FP_EQ(FPT(-M_PI), func(CFPT{neg_inf, -1.0}));
     EXPECT_FP_EQ(FPT(-M_PI), func(CFPT{neg_inf, -512.0}));
     // carg(-inf + 0i) = +pi
     EXPECT_FP_EQ(FPT(M_PI), func(CFPT{neg_inf, 0.0}));
diff --git a/libc/test/src/complex/carg_test.cpp b/libc/test/src/complex/carg_test.cpp
index f6fd1d7df..cdef19aea 100644
--- a/libc/test/src/complex/carg_test.cpp
+++ b/libc/test/src/complex/carg_test.cpp
@@ -1,4 +1,5 @@
-//===-- Unittests for carg -------------------------------------------------===//
+//===-- Unittests for carg
+//-------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/libc/test/src/complex/cargf_test.cpp b/libc/test/src/complex/cargf_test.cpp
index 1c47be9c6..ebd114aa5 100644
--- a/libc/test/src/complex/cargf_test.cpp
+++ b/libc/test/src/complex/cargf_test.cpp
@@ -1,4 +1,5 @@
-//===-- Unittests for cargf ------------------------------------------------===//
+//===-- Unittests for cargf
+//------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.

``````````

</details>


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


More information about the libc-commits mailing list