Skip to content

Commit 81c40e5

Browse files
committed
Cleanup remquo test cases
1 parent eb9c197 commit 81c40e5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/basic/remquo_test.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
#include <limits>
1414

1515

16-
1716
constexpr double get_ccm_rem(double x, double y)
1817
{
1918
int quotient {0};
20-
double remainder = ccm::remquo(x, y, &quotient); // remainder = 1
19+
double remainder = ccm::remquo(x, y, &quotient);
2120
return remainder;
2221
}
2322

@@ -31,20 +30,20 @@ constexpr int get_ccm_quo(double x, double y)
3130
double get_std_rem(double x, double y)
3231
{
3332
int quotient {0};
34-
double remainder = std::remquo(x, y, &quotient); // remainder = 1
33+
double remainder = std::remquo(x, y, &quotient);
3534
return remainder;
3635
}
3736

3837
int get_std_quo(double x, double y)
3938
{
4039
int quotient {0};
41-
std::remquo(x, y, &quotient); // remainder = 1
40+
std::remquo(x, y, &quotient);
4241
return quotient;
4342
}
4443

45-
4644
TEST(CcmathBasicTests, Remquo)
4745
{
46+
// Test that remquo can be uses in a static_assert
4847
constexpr double sa_x = -7.0, sa_y = 2.0;
4948
constexpr int sa_quotient = get_ccm_quo(sa_x, sa_y); // quotient = -4
5049
constexpr double sa_remainder = get_ccm_rem(sa_x, sa_y); // remainder = 1
@@ -81,8 +80,6 @@ TEST(CcmathBasicTests, Remquo)
8180
EXPECT_EQ(didCcmLeftNegativeInfinityReturnNan, didStdLeftNegativeInfinityReturnNan);
8281
EXPECT_EQ(get_ccm_quo(-std::numeric_limits<double>::infinity(), 2.0), get_std_quo(-std::numeric_limits<double>::infinity(), 2.0));
8382

84-
85-
8683
// Test with NaN
8784
bool isCcmLeftNanNegative = (std::signbit(get_ccm_rem(std::numeric_limits<double>::quiet_NaN(), 2.0)) == true && std::isnan(get_ccm_rem(std::numeric_limits<double>::quiet_NaN(), 2.0)) == true); // NOLINT
8885
bool isStdLeftNanNegative = (std::signbit(get_std_rem(std::numeric_limits<double>::quiet_NaN(), 2.0)) == true && std::isnan(get_std_rem(std::numeric_limits<double>::quiet_NaN(), 2.0)) == true); // NOLINT
@@ -101,5 +98,5 @@ TEST(CcmathBasicTests, Remquo)
10198
EXPECT_EQ(didCcmLeftNegativeNanReturnNan, didStdLeftNegativeNanReturnNan);
10299
EXPECT_EQ(get_ccm_quo(-std::numeric_limits<double>::quiet_NaN(), 2.0), get_std_quo(-std::numeric_limits<double>::quiet_NaN(), 2.0));
103100

104-
101+
// TODO: Add more test cases for remquo.
105102
}

0 commit comments

Comments
 (0)