[libc-commits] [libc] [libc][math][c++23] Add exp2bf16 math function (PR #230213)
via libc-commits
libc-commits at lists.llvm.org
Fri Oct 9 09:53:12 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/shared/math/exp2bf16.h libc/src/__support/math/exp2bf16.h libc/src/math/exp2bf16.h libc/src/math/generic/exp2bf16.cpp libc/test/src/math/exp2bf16_test.cpp libc/test/src/math/smoke/exp2bf16_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/math/smoke/exp2bf16_test.cpp b/libc/test/src/math/smoke/exp2bf16_test.cpp
index 7aeaf25a2..4d236400a 100644
--- a/libc/test/src/math/smoke/exp2bf16_test.cpp
+++ b/libc/test/src/math/smoke/exp2bf16_test.cpp
@@ -39,22 +39,21 @@ public:
LIBC_NAMESPACE::exp2bf16(neg_zero));
EXPECT_MATH_ERRNO(0);
- EXPECT_FP_EQ_WITH_EXCEPTION(
- inf, LIBC_NAMESPACE::exp2bf16(max_normal), FE_OVERFLOW);
+ EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2bf16(max_normal),
+ FE_OVERFLOW);
EXPECT_MATH_ERRNO(ERANGE);
- EXPECT_FP_EQ_WITH_EXCEPTION(
- inf, LIBC_NAMESPACE::exp2bf16(bfloat16(128.0f)), FE_OVERFLOW);
+ EXPECT_FP_EQ_WITH_EXCEPTION(inf, LIBC_NAMESPACE::exp2bf16(bfloat16(128.0f)),
+ FE_OVERFLOW);
EXPECT_MATH_ERRNO(ERANGE);
- EXPECT_FP_EQ_WITH_EXCEPTION(
- zero, LIBC_NAMESPACE::exp2bf16(neg_max_normal),
- FE_UNDERFLOW | FE_INEXACT);
+ EXPECT_FP_EQ_WITH_EXCEPTION(zero, LIBC_NAMESPACE::exp2bf16(neg_max_normal),
+ FE_UNDERFLOW | FE_INEXACT);
EXPECT_MATH_ERRNO(ERANGE);
- EXPECT_FP_EQ_WITH_EXCEPTION(
- zero, LIBC_NAMESPACE::exp2bf16(bfloat16(-134.0f)),
- FE_UNDERFLOW | FE_INEXACT);
+ EXPECT_FP_EQ_WITH_EXCEPTION(zero,
+ LIBC_NAMESPACE::exp2bf16(bfloat16(-134.0f)),
+ FE_UNDERFLOW | FE_INEXACT);
EXPECT_MATH_ERRNO(ERANGE);
}
};
``````````
</details>
https://github.com/llvm/llvm-project/pull/230213
More information about the libc-commits
mailing list