diff options
| author | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
|---|---|---|
| committer | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
| commit | a0abc0af0a0a90878822f8107d70dad6f7cdfc26 (patch) | |
| tree | 3317f49277cc325327cfe3d9a7be4b6e9bacd0f5 /libc/test/src/math/log10f16_test.cpp | |
| parent | e8230892228fd3b3e543c869f1238fa199d48bc1 (diff) | |
| parent | 735b1ad667ac7373c89ccc0f0e757ef418f8f790 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/fmayer/spr/main.wip-smartpointers
Created using spr 1.3.7
[skip ci]
Diffstat (limited to 'libc/test/src/math/log10f16_test.cpp')
| -rw-r--r-- | libc/test/src/math/log10f16_test.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libc/test/src/math/log10f16_test.cpp b/libc/test/src/math/log10f16_test.cpp index a71e3309ac5f..0e456dc96a6c 100644 --- a/libc/test/src/math/log10f16_test.cpp +++ b/libc/test/src/math/log10f16_test.cpp @@ -6,11 +6,18 @@ // //===----------------------------------------------------------------------===// +#include "src/__support/macros/optimization.h" #include "src/math/log10f16.h" #include "test/UnitTest/FPMatcher.h" #include "test/UnitTest/Test.h" #include "utils/MPFRWrapper/MPFRUtils.h" +#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS +#define TOLERANCE 1 +#else +#define TOLERANCE 0 +#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS + using LlvmLibcLog10f16Test = LIBC_NAMESPACE::testing::FPTest<float16>; namespace mpfr = LIBC_NAMESPACE::testing::mpfr; @@ -27,7 +34,8 @@ TEST_F(LlvmLibcLog10f16Test, PositiveRange) { for (uint16_t v = POS_START; v <= POS_STOP; ++v) { float16 x = FPBits(v).get_val(); EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Log10, x, - LIBC_NAMESPACE::log10f16(x), 0.5); + LIBC_NAMESPACE::log10f16(x), + TOLERANCE + 0.5); } } @@ -35,6 +43,7 @@ TEST_F(LlvmLibcLog10f16Test, NegativeRange) { for (uint16_t v = NEG_START; v <= NEG_STOP; ++v) { float16 x = FPBits(v).get_val(); EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Log10, x, - LIBC_NAMESPACE::log10f16(x), 0.5); + LIBC_NAMESPACE::log10f16(x), + TOLERANCE + 0.5); } } |
