[libc-commits] [libc] [libc][math][c23] Add atanhf16 C23 math function. (PR #132612)
via libc-commits
libc-commits at lists.llvm.org
Wed Mar 26 08:00:57 PDT 2025
================
@@ -0,0 +1,42 @@
+//===-- Unittests for atanhf16 --------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/errno/libc_errno.h"
+#include "src/math/atanhf16.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+#include <stdint.h>
+
+using LlvmLibcAtanhf16Test = LIBC_NAMESPACE::testing::FPTest<float16>;
+namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
+
+// Range for positive numbers: [0, 1)
+static constexpr uint16_t POS_START = 0x0000U;
+static constexpr uint16_t POS_STOP = 0x3C00;
----------------
lntue wrote:
I think our MPFR testing now can take care of inf/nan cases. So you should be able to test for the entire range.
https://github.com/llvm/llvm-project/pull/132612
More information about the libc-commits
mailing list