Skip to content

Commit 25226f3

Browse files
[libc] apply formatting to tests
Apply the formatting rules that were applied to the libc/src directory to the libc/test directory, as well as the files in libc/utils that are included by the tests. This does not include automated enforcement. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D116127
1 parent 8b58344 commit 25226f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+900
-872
lines changed

libc/benchmarks/LibcBenchmarkTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ class LibcBenchmark : public ::testing::Test {
5050
}
5151

5252
protected:
53-
void SetUp() override { Options.Log = BenchmarkLog::Full; }
53+
void set_up() override { Options.Log = BenchmarkLog::Full; }
5454

55-
void TearDown() override {
55+
void tear_down() override {
5656
// We make sure all the expected measurements were performed.
5757
if (MaybeTimepoints)
5858
EXPECT_THAT(*MaybeTimepoints, IsEmpty());

libc/benchmarks/automemcpy/lib/ResultAnalyzerMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ JsonFile parseJsonResultFile(StringRef Filename) {
9494
json::Path::Root Root;
9595
JsonFile JF;
9696
if (!fromJSON(JsonValue, JF, Root))
97-
ExitOnErr(Root.getError());
97+
ExitOnErr(Root.get_error());
9898
return JF;
9999
}
100100

libc/test/config/linux/x86_64/syscall_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ TEST(LlvmLibcX86_64_SyscallTest, APITest) {
3939
return __llvm_libc::syscall(n, a1, a2, a3, a4, a5, a6);
4040
});
4141

42-
Function<long(long, void *)> notLongType(
42+
Function<long(long, void *)> not_long_type(
4343
[](long n, void *a1) { return __llvm_libc::syscall(n, a1); });
4444
}

libc/test/src/__support/str_to_float_test.cpp

Lines changed: 114 additions & 106 deletions
Large diffs are not rendered by default.

libc/test/src/fenv/enabled_exceptions_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST(LlvmLibcExceptionStatusTest, RaiseAndCrash) {
4646
// We '|' the individual exception flags instead of using FE_ALL_EXCEPT
4747
// as it can include non-standard extensions. Note that we should be able
4848
// to compile this file with headers from other libcs as well.
49-
constexpr int allExcepts =
49+
constexpr int ALL_EXCEPTS =
5050
FE_DIVBYZERO | FE_INVALID | FE_INEXACT | FE_OVERFLOW | FE_UNDERFLOW;
5151

5252
for (int e : excepts) {
@@ -59,7 +59,7 @@ TEST(LlvmLibcExceptionStatusTest, RaiseAndCrash) {
5959
// can raise FE_INEXACT as well, we don't verify the other
6060
// exception flags when FE_INEXACT is enabled.
6161
if (e != FE_INEXACT) {
62-
int others = allExcepts & ~e;
62+
int others = ALL_EXCEPTS & ~e;
6363
ASSERT_EQ(__llvm_libc::feraiseexcept(others), 0);
6464
ASSERT_EQ(__llvm_libc::fetestexcept(others), others);
6565
}

libc/test/src/fenv/exception_status_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TEST(LlvmLibcExceptionStatusTest, RaiseAndTest) {
2525
int excepts[] = {FE_DIVBYZERO, FE_INVALID, FE_INEXACT, FE_OVERFLOW,
2626
FE_UNDERFLOW};
2727

28-
constexpr int allExcepts =
28+
constexpr int ALL_EXCEPTS =
2929
FE_DIVBYZERO | FE_INVALID | FE_INEXACT | FE_OVERFLOW | FE_UNDERFLOW;
3030

3131
for (int e : excepts) {
@@ -112,8 +112,8 @@ TEST(LlvmLibcExceptionStatusTest, RaiseAndTest) {
112112
}
113113
}
114114

115-
int r = __llvm_libc::feraiseexcept(allExcepts);
115+
int r = __llvm_libc::feraiseexcept(ALL_EXCEPTS);
116116
ASSERT_EQ(r, 0);
117-
int s = __llvm_libc::fetestexcept(allExcepts);
118-
ASSERT_EQ(s, allExcepts);
117+
int s = __llvm_libc::fetestexcept(ALL_EXCEPTS);
118+
ASSERT_EQ(s, ALL_EXCEPTS);
119119
}

libc/test/src/math/CeilTest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ template <typename T> class CeilTest : public __llvm_libc::testing::Test {
6464
}
6565

6666
void testRange(CeilFunc func) {
67-
constexpr UIntType count = 10000000;
68-
constexpr UIntType step = UIntType(-1) / count;
69-
for (UIntType i = 0, v = 0; i <= count; ++i, v += step) {
67+
constexpr UIntType COUNT = 10000000;
68+
constexpr UIntType STEP = UIntType(-1) / COUNT;
69+
for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
7070
T x = T(FPBits(v));
7171
if (isnan(x) || isinf(x))
7272
continue;

libc/test/src/math/CopySignTest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ template <typename T> class CopySignTest : public __llvm_libc::testing::Test {
3333
}
3434

3535
void testRange(CopySignFunc func) {
36-
constexpr UIntType count = 10000000;
37-
constexpr UIntType step = UIntType(-1) / count;
38-
for (UIntType i = 0, v = 0; i <= count; ++i, v += step) {
36+
constexpr UIntType COUNT = 10000000;
37+
constexpr UIntType STEP = UIntType(-1) / COUNT;
38+
for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
3939
T x = T(FPBits(v));
4040
if (isnan(x) || isinf(x))
4141
continue;

libc/test/src/math/FAbsTest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ template <typename T> class FAbsTest : public __llvm_libc::testing::Test {
3232
}
3333

3434
void testRange(FabsFunc func) {
35-
constexpr UIntType count = 10000000;
36-
constexpr UIntType step = UIntType(-1) / count;
37-
for (UIntType i = 0, v = 0; i <= count; ++i, v += step) {
35+
constexpr UIntType COUNT = 10000000;
36+
constexpr UIntType STEP = UIntType(-1) / COUNT;
37+
for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
3838
T x = T(FPBits(v));
3939
if (isnan(x) || isinf(x))
4040
continue;

libc/test/src/math/FDimTest.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FDimTestTemplate : public __llvm_libc::testing::Test {
1919
using FPBits = __llvm_libc::fputil::FPBits<T>;
2020
using UIntType = typename FPBits::UIntType;
2121

22-
void testNaNArg(FuncPtr func) {
22+
void test_na_n_arg(FuncPtr func) {
2323
EXPECT_FP_EQ(nan, func(nan, inf));
2424
EXPECT_FP_EQ(nan, func(neg_inf, nan));
2525
EXPECT_FP_EQ(nan, func(nan, zero));
@@ -29,34 +29,34 @@ class FDimTestTemplate : public __llvm_libc::testing::Test {
2929
EXPECT_FP_EQ(func(nan, nan), nan);
3030
}
3131

32-
void testInfArg(FuncPtr func) {
32+
void test_inf_arg(FuncPtr func) {
3333
EXPECT_FP_EQ(zero, func(neg_inf, inf));
3434
EXPECT_FP_EQ(inf, func(inf, zero));
3535
EXPECT_FP_EQ(zero, func(neg_zero, inf));
3636
EXPECT_FP_EQ(inf, func(inf, T(1.2345)));
3737
EXPECT_FP_EQ(zero, func(T(-1.2345), inf));
3838
}
3939

40-
void testNegInfArg(FuncPtr func) {
40+
void test_neg_inf_arg(FuncPtr func) {
4141
EXPECT_FP_EQ(inf, func(inf, neg_inf));
4242
EXPECT_FP_EQ(zero, func(neg_inf, zero));
4343
EXPECT_FP_EQ(inf, func(neg_zero, neg_inf));
4444
EXPECT_FP_EQ(zero, func(neg_inf, T(-1.2345)));
4545
EXPECT_FP_EQ(inf, func(T(1.2345), neg_inf));
4646
}
4747

48-
void testBothZero(FuncPtr func) {
48+
void test_both_zero(FuncPtr func) {
4949
EXPECT_FP_EQ(zero, func(zero, zero));
5050
EXPECT_FP_EQ(zero, func(zero, neg_zero));
5151
EXPECT_FP_EQ(zero, func(neg_zero, zero));
5252
EXPECT_FP_EQ(zero, func(neg_zero, neg_zero));
5353
}
5454

55-
void testInRange(FuncPtr func) {
56-
constexpr UIntType count = 10000001;
57-
constexpr UIntType step = UIntType(-1) / count;
58-
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= count;
59-
++i, v += step, w -= step) {
55+
void test_in_range(FuncPtr func) {
56+
constexpr UIntType COUNT = 10000001;
57+
constexpr UIntType STEP = UIntType(-1) / COUNT;
58+
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
59+
++i, v += STEP, w -= STEP) {
6060
T x = T(FPBits(v)), y = T(FPBits(w));
6161
if (isnan(x) || isinf(x))
6262
continue;

libc/test/src/math/FMaxTest.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ template <typename T> class FMaxTest : public __llvm_libc::testing::Test {
5555
}
5656

5757
void testRange(FMaxFunc func) {
58-
constexpr UIntType count = 10000001;
59-
constexpr UIntType step = UIntType(-1) / count;
60-
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= count;
61-
++i, v += step, w -= step) {
58+
constexpr UIntType COUNT = 10000001;
59+
constexpr UIntType STEP = UIntType(-1) / COUNT;
60+
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
61+
++i, v += STEP, w -= STEP) {
6262
T x = T(FPBits(v)), y = T(FPBits(w));
6363
if (isnan(x) || isinf(x))
6464
continue;

libc/test/src/math/FMinTest.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ template <typename T> class FMinTest : public __llvm_libc::testing::Test {
5555
}
5656

5757
void testRange(FMinFunc func) {
58-
constexpr UIntType count = 10000001;
59-
constexpr UIntType step = UIntType(-1) / count;
60-
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= count;
61-
++i, v += step, w -= step) {
58+
constexpr UIntType COUNT = 10000001;
59+
constexpr UIntType STEP = UIntType(-1) / COUNT;
60+
for (UIntType i = 0, v = 0, w = UIntType(-1); i <= COUNT;
61+
++i, v += STEP, w -= STEP) {
6262
T x = T(FPBits(v)), y = T(FPBits(w));
6363
if (isnan(x) || isinf(x))
6464
continue;

libc/test/src/math/FloorTest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ template <typename T> class FloorTest : public __llvm_libc::testing::Test {
6464
}
6565

6666
void testRange(FloorFunc func) {
67-
constexpr UIntType count = 10000000;
68-
constexpr UIntType step = UIntType(-1) / count;
69-
for (UIntType i = 0, v = 0; i <= count; ++i, v += step) {
67+
constexpr UIntType COUNT = 10000000;
68+
constexpr UIntType STEP = UIntType(-1) / COUNT;
69+
for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
7070
T x = T(FPBits(v));
7171
if (isnan(x) || isinf(x))
7272
continue;

libc/test/src/math/FmaTest.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FmaTestTemplate : public __llvm_libc::testing::Test {
2929
const T zero = T(__llvm_libc::fputil::FPBits<T>::zero());
3030
const T neg_zero = T(__llvm_libc::fputil::FPBits<T>::neg_zero());
3131

32-
UIntType getRandomBitPattern() {
32+
UIntType get_random_bit_pattern() {
3333
UIntType bits{0};
3434
for (UIntType i = 0; i < sizeof(UIntType) / 2; ++i) {
3535
bits =
@@ -39,7 +39,7 @@ class FmaTestTemplate : public __llvm_libc::testing::Test {
3939
}
4040

4141
public:
42-
void testSpecialNumbers(Func func) {
42+
void test_special_numbers(Func func) {
4343
EXPECT_FP_EQ(func(zero, zero, zero), zero);
4444
EXPECT_FP_EQ(func(zero, neg_zero, neg_zero), neg_zero);
4545
EXPECT_FP_EQ(func(inf, inf, zero), inf);
@@ -63,29 +63,29 @@ class FmaTestTemplate : public __llvm_libc::testing::Test {
6363
EXPECT_FP_EQ(func(T(1.75), z, -z), T(0.75) * z);
6464
}
6565

66-
void testSubnormalRange(Func func) {
67-
constexpr UIntType count = 1000001;
68-
constexpr UIntType step =
69-
(FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / count;
66+
void test_subnormal_range(Func func) {
67+
constexpr UIntType COUNT = 1000001;
68+
constexpr UIntType STEP =
69+
(FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
7070
for (UIntType v = FPBits::MIN_SUBNORMAL, w = FPBits::MAX_SUBNORMAL;
7171
v <= FPBits::MAX_SUBNORMAL && w >= FPBits::MIN_SUBNORMAL;
72-
v += step, w -= step) {
73-
T x = T(FPBits(getRandomBitPattern())), y = T(FPBits(v)),
72+
v += STEP, w -= STEP) {
73+
T x = T(FPBits(get_random_bit_pattern())), y = T(FPBits(v)),
7474
z = T(FPBits(w));
7575
T result = func(x, y, z);
7676
mpfr::TernaryInput<T> input{x, y, z};
7777
ASSERT_MPFR_MATCH(mpfr::Operation::Fma, input, result, 0.5);
7878
}
7979
}
8080

81-
void testNormalRange(Func func) {
82-
constexpr UIntType count = 1000001;
83-
constexpr UIntType step = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / count;
81+
void test_normal_range(Func func) {
82+
constexpr UIntType COUNT = 1000001;
83+
constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
8484
for (UIntType v = FPBits::MIN_NORMAL, w = FPBits::MAX_NORMAL;
8585
v <= FPBits::MAX_NORMAL && w >= FPBits::MIN_NORMAL;
86-
v += step, w -= step) {
86+
v += STEP, w -= STEP) {
8787
T x = T(FPBits(v)), y = T(FPBits(w)),
88-
z = T(FPBits(getRandomBitPattern()));
88+
z = T(FPBits(get_random_bit_pattern()));
8989
T result = func(x, y, z);
9090
mpfr::TernaryInput<T> input{x, y, z};
9191
ASSERT_MPFR_MATCH(mpfr::Operation::Fma, input, result, 0.5);

libc/test/src/math/FrexpTest.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ template <typename T> class FrexpTest : public __llvm_libc::testing::Test {
1919

2020
DECLARE_SPECIAL_CONSTANTS(T)
2121

22-
static constexpr UIntType HiddenBit =
22+
static constexpr UIntType HIDDEN_BIT =
2323
UIntType(1) << __llvm_libc::fputil::MantissaWidth<T>::VALUE;
2424

2525
public:
@@ -93,9 +93,9 @@ template <typename T> class FrexpTest : public __llvm_libc::testing::Test {
9393

9494
void testRange(FrexpFunc func) {
9595
using UIntType = typename FPBits::UIntType;
96-
constexpr UIntType count = 10000000;
97-
constexpr UIntType step = UIntType(-1) / count;
98-
for (UIntType i = 0, v = 0; i <= count; ++i, v += step) {
96+
constexpr UIntType COUNT = 10000000;
97+
constexpr UIntType STEP = UIntType(-1) / COUNT;
98+
for (UIntType i = 0, v = 0; i <= COUNT; ++i, v += STEP) {
9999
T x = static_cast<T>(FPBits(v));
100100
if (isnan(x) || isinf(x) || x == 0.0l)
101101
continue;

libc/test/src/math/HypotTest.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class HypotTestTemplate : public __llvm_libc::testing::Test {
3232
const T neg_zero = T(__llvm_libc::fputil::FPBits<T>::neg_zero());
3333

3434
public:
35-
void testSpecialNumbers(Func func) {
35+
void test_special_numbers(Func func) {
3636
EXPECT_FP_EQ(func(inf, nan), inf);
3737
EXPECT_FP_EQ(func(nan, neg_inf), inf);
3838
EXPECT_FP_EQ(func(zero, inf), inf);
@@ -45,14 +45,14 @@ class HypotTestTemplate : public __llvm_libc::testing::Test {
4545
EXPECT_FP_EQ(func(neg_zero, zero), zero);
4646
}
4747

48-
void testSubnormalRange(Func func) {
49-
constexpr UIntType count = 1000001;
48+
void test_subnormal_range(Func func) {
49+
constexpr UIntType COUNT = 1000001;
5050
for (unsigned scale = 0; scale < 4; ++scale) {
51-
UIntType maxValue = FPBits::MAX_SUBNORMAL << scale;
52-
UIntType step = (maxValue - FPBits::MIN_SUBNORMAL) / count;
51+
UIntType max_value = FPBits::MAX_SUBNORMAL << scale;
52+
UIntType step = (max_value - FPBits::MIN_SUBNORMAL) / COUNT;
5353
for (int signs = 0; signs < 4; ++signs) {
54-
for (UIntType v = FPBits::MIN_SUBNORMAL, w = maxValue;
55-
v <= maxValue && w >= FPBits::MIN_SUBNORMAL;
54+
for (UIntType v = FPBits::MIN_SUBNORMAL, w = max_value;
55+
v <= max_value && w >= FPBits::MIN_SUBNORMAL;
5656
v += step, w -= step) {
5757
T x = T(FPBits(v)), y = T(FPBits(w));
5858
if (signs % 2 == 1) {
@@ -70,13 +70,13 @@ class HypotTestTemplate : public __llvm_libc::testing::Test {
7070
}
7171
}
7272

73-
void testNormalRange(Func func) {
74-
constexpr UIntType count = 1000001;
75-
constexpr UIntType step = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / count;
73+
void test_normal_range(Func func) {
74+
constexpr UIntType COUNT = 1000001;
75+
constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
7676
for (int signs = 0; signs < 4; ++signs) {
7777
for (UIntType v = FPBits::MIN_NORMAL, w = FPBits::MAX_NORMAL;
7878
v <= FPBits::MAX_NORMAL && w >= FPBits::MIN_NORMAL;
79-
v += step, w -= step) {
79+
v += STEP, w -= STEP) {
8080
T x = T(FPBits(v)), y = T(FPBits(w));
8181
if (signs % 2 == 1) {
8282
x = -x;

libc/test/src/math/ILogbTest.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
2121
template <typename T> struct ILogbFunc { typedef int (*Func)(T); };
2222

2323
template <typename T>
24-
void testSpecialNumbers(typename ILogbFunc<T>::Func func) {
24+
void test_special_numbers(typename ILogbFunc<T>::Func func) {
2525
EXPECT_EQ(FP_ILOGB0, func(T(__llvm_libc::fputil::FPBits<T>::zero())));
2626
EXPECT_EQ(FP_ILOGB0, func(T(__llvm_libc::fputil::FPBits<T>::neg_zero())));
2727

@@ -32,7 +32,8 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
3232
EXPECT_EQ(INT_MAX, func(T(__llvm_libc::fputil::FPBits<T>::neg_inf())));
3333
}
3434

35-
template <typename T> void testPowersOfTwo(typename ILogbFunc<T>::Func func) {
35+
template <typename T>
36+
void test_powers_of_two(typename ILogbFunc<T>::Func func) {
3637
EXPECT_EQ(0, func(T(1.0)));
3738
EXPECT_EQ(0, func(T(-1.0)));
3839

@@ -53,7 +54,7 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
5354
}
5455

5556
template <typename T>
56-
void testSomeIntegers(typename ILogbFunc<T>::Func func) {
57+
void test_some_integers(typename ILogbFunc<T>::Func func) {
5758
EXPECT_EQ(1, func(T(3.0)));
5859
EXPECT_EQ(1, func(T(-3.0)));
5960

@@ -71,14 +72,14 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
7172
}
7273

7374
template <typename T>
74-
void testSubnormalRange(typename ILogbFunc<T>::Func func) {
75+
void test_subnormal_range(typename ILogbFunc<T>::Func func) {
7576
using FPBits = __llvm_libc::fputil::FPBits<T>;
7677
using UIntType = typename FPBits::UIntType;
77-
constexpr UIntType count = 1000001;
78-
constexpr UIntType step =
79-
(FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / count;
78+
constexpr UIntType COUNT = 1000001;
79+
constexpr UIntType STEP =
80+
(FPBits::MAX_SUBNORMAL - FPBits::MIN_SUBNORMAL) / COUNT;
8081
for (UIntType v = FPBits::MIN_SUBNORMAL; v <= FPBits::MAX_SUBNORMAL;
81-
v += step) {
82+
v += STEP) {
8283
T x = T(FPBits(v));
8384
if (isnan(x) || isinf(x) || x == 0.0)
8485
continue;
@@ -89,12 +90,13 @@ class LlvmLibcILogbTest : public __llvm_libc::testing::Test {
8990
}
9091
}
9192

92-
template <typename T> void testNormalRange(typename ILogbFunc<T>::Func func) {
93+
template <typename T>
94+
void test_normal_range(typename ILogbFunc<T>::Func func) {
9395
using FPBits = __llvm_libc::fputil::FPBits<T>;
9496
using UIntType = typename FPBits::UIntType;
95-
constexpr UIntType count = 1000001;
96-
constexpr UIntType step = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / count;
97-
for (UIntType v = FPBits::MIN_NORMAL; v <= FPBits::MAX_NORMAL; v += step) {
97+
constexpr UIntType COUNT = 1000001;
98+
constexpr UIntType STEP = (FPBits::MAX_NORMAL - FPBits::MIN_NORMAL) / COUNT;
99+
for (UIntType v = FPBits::MIN_NORMAL; v <= FPBits::MAX_NORMAL; v += STEP) {
98100
T x = T(FPBits(v));
99101
if (isnan(x) || isinf(x) || x == 0.0)
100102
continue;

0 commit comments

Comments
 (0)