Skip to content

Commit bea54fc

Browse files
committed
[libc][math] Update range.
1 parent 049b363 commit bea54fc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libc/test/src/math/atanhf16_test.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,24 @@
1717
using LlvmLibcAtanhf16Test = LIBC_NAMESPACE::testing::FPTest<float16>;
1818
namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
1919

20+
// Range for positive numbers: [0, 1)
2021
static constexpr uint16_t POS_START = 0x0000U;
21-
static constexpr uint16_t POS_STOP = 0x3BFFU;
22+
static constexpr uint16_t POS_STOP = 0x3C00;
23+
24+
// Range for negative numbers: (-1, 0]
2225
static constexpr uint16_t NEG_START = 0xBBFFU;
2326
static constexpr uint16_t NEG_STOP = 0x8000U;
2427

2528
TEST_F(LlvmLibcAtanhf16Test, PositiveRange) {
26-
for (uint16_t v = POS_START; v <= POS_STOP; ++v) {
29+
for (uint16_t v = POS_START; v < POS_STOP; ++v) {
2730
float16 x = FPBits(v).get_val();
2831
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Atanh, x,
2932
LIBC_NAMESPACE::atanhf16(x), 0.5);
3033
}
3134
}
3235

3336
TEST_F(LlvmLibcAtanhf16Test, NegativeRange) {
34-
for (uint16_t v = NEG_START; v <= NEG_STOP; --v) {
37+
for (uint16_t v = NEG_START; v >= NEG_STOP; --v) {
3538
float16 x = FPBits(v).get_val();
3639
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Atanh, x,
3740
LIBC_NAMESPACE::atanhf16(x), 0.5);

0 commit comments

Comments
 (0)