[llvm] [APFloat] add power (PR #122889)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 10:40:00 PST 2025


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 0bf1591d01a218dff236e94ca9e0880013129855 8f6da4e6352e4416d53c334f228225cf22ef7b6d --extensions h,cpp -- llvm/include/llvm/ADT/APFloat.h llvm/unittests/ADT/APFloatTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/ADT/APFloatTest.cpp b/llvm/unittests/ADT/APFloatTest.cpp
index b85ba0eb88..1d25634d66 100644
--- a/llvm/unittests/ADT/APFloatTest.cpp
+++ b/llvm/unittests/ADT/APFloatTest.cpp
@@ -3808,12 +3808,12 @@ TEST(APFloatTest, powi) {
   APFloat NegQNaN = APFloat::getNaN(APFloat::IEEEsingle(), true);
   APFloat PosSNaN = APFloat::getSNaN(APFloat::IEEEsingle(), false);
   APFloat NegSNaN = APFloat::getSNaN(APFloat::IEEEsingle(), true);
-  
+
   EXPECT_TRUE(One.bitwiseIsEqual(powi(One, 0)));
   EXPECT_TRUE(One.bitwiseIsEqual(powi(One, 3)));
   EXPECT_TRUE(Four.bitwiseIsEqual(powi(Two, 2)));
   EXPECT_TRUE(Eight.bitwiseIsEqual(powi(Two, 3)));
-  
+
   // See page 63 of IEEE 754-2019.
   EXPECT_TRUE(One.bitwiseIsEqual(powi(PosInf, 0)));
   EXPECT_TRUE(NegEight.bitwiseIsEqual(powi(NegTwo, 3)));
@@ -3823,7 +3823,7 @@ TEST(APFloatTest, powi) {
   EXPECT_TRUE(NegInf.bitwiseIsEqual(powi(NegInf, 3)));
   EXPECT_TRUE(PosInf.bitwiseIsEqual(powi(NegInf, 4)));
   EXPECT_TRUE(PosInf.bitwiseIsEqual(powi(PosInf, 3)));
-  
+
   EXPECT_TRUE(PosQNaN.bitwiseIsEqual(powi(PosQNaN, 1)));
   EXPECT_TRUE(NegQNaN.bitwiseIsEqual(powi(NegQNaN, 1)));
   // Check signaling NaN is quieted for n == 1.

``````````

</details>


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


More information about the llvm-commits mailing list