diff options
Diffstat (limited to 'test/src/math/smoke/ModfTest.h')
-rw-r--r-- | test/src/math/smoke/ModfTest.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/src/math/smoke/ModfTest.h b/test/src/math/smoke/ModfTest.h index a73e5ae4298f..107963665b83 100644 --- a/test/src/math/smoke/ModfTest.h +++ b/test/src/math/smoke/ModfTest.h @@ -11,7 +11,7 @@ #include "test/UnitTest/FPMatcher.h" #include "test/UnitTest/Test.h" -#include <math.h> +#include "include/llvm-libc-macros/math-macros.h" template <typename T> class ModfTest : public LIBC_NAMESPACE::testing::Test { @@ -84,10 +84,12 @@ public: constexpr StorageType COUNT = 100'000; constexpr StorageType STEP = STORAGE_MAX / COUNT; for (StorageType i = 0, v = 0; i <= COUNT; ++i, v += STEP) { - T x = FPBits(v).get_val(); - if (isnan(x) || isinf(x) || x == T(0.0)) + FPBits x_bits = FPBits(v); + if (x_bits.is_zero() || x_bits.is_inf_or_nan()) continue; + T x = x_bits.get_val(); + T integral; T frac = func(x, &integral); ASSERT_TRUE(LIBC_NAMESPACE::fputil::abs(frac) < 1.0l); |