diff options
Diffstat (limited to 'libc/test/src/math/FmaTest.h')
-rw-r--r-- | libc/test/src/math/FmaTest.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/test/src/math/FmaTest.h b/libc/test/src/math/FmaTest.h index 5c5419c..902ff04 100644 --- a/libc/test/src/math/FmaTest.h +++ b/libc/test/src/math/FmaTest.h @@ -48,7 +48,8 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest { InStorageType get_random_bit_pattern() { InStorageType bits{0}; for (InStorageType i = 0; i < sizeof(InStorageType) / 2; ++i) { - bits = (bits << 2) + static_cast<uint16_t>(LIBC_NAMESPACE::rand()); + bits = static_cast<InStorageType>( + (bits << 2) + static_cast<uint16_t>(LIBC_NAMESPACE::rand())); } return bits; } @@ -57,7 +58,7 @@ public: using FmaFunc = OutType (*)(InType, InType, InType); void test_subnormal_range(FmaFunc func) { - constexpr InStorageType COUNT = 100'001; + constexpr InStorageType COUNT = 10'001; constexpr InStorageType RAW_STEP = (IN_MAX_SUBNORMAL_U - IN_MIN_SUBNORMAL_U) / COUNT; constexpr InStorageType STEP = (RAW_STEP == 0 ? 1 : RAW_STEP); @@ -75,7 +76,7 @@ public: } void test_normal_range(FmaFunc func) { - constexpr InStorageType COUNT = 100'001; + constexpr InStorageType COUNT = 10'001; constexpr InStorageType RAW_STEP = (IN_MAX_NORMAL_U - IN_MIN_NORMAL_U) / COUNT; constexpr InStorageType STEP = (RAW_STEP == 0 ? 1 : RAW_STEP); |