diff --git a/test/basic/remquo_test.cpp b/test/basic/remquo_test.cpp index 1bd09d9c..cd8da436 100644 --- a/test/basic/remquo_test.cpp +++ b/test/basic/remquo_test.cpp @@ -13,11 +13,10 @@ #include - constexpr double get_ccm_rem(double x, double y) { int quotient {0}; - double remainder = ccm::remquo(x, y, "ient); // remainder = 1 + double remainder = ccm::remquo(x, y, "ient); return remainder; } @@ -31,20 +30,20 @@ constexpr int get_ccm_quo(double x, double y) double get_std_rem(double x, double y) { int quotient {0}; - double remainder = std::remquo(x, y, "ient); // remainder = 1 + double remainder = std::remquo(x, y, "ient); return remainder; } int get_std_quo(double x, double y) { int quotient {0}; - std::remquo(x, y, "ient); // remainder = 1 + std::remquo(x, y, "ient); return quotient; } - TEST(CcmathBasicTests, Remquo) { + // Test that remquo can be uses in a static_assert constexpr double sa_x = -7.0, sa_y = 2.0; constexpr int sa_quotient = get_ccm_quo(sa_x, sa_y); // quotient = -4 constexpr double sa_remainder = get_ccm_rem(sa_x, sa_y); // remainder = 1 @@ -81,8 +80,6 @@ TEST(CcmathBasicTests, Remquo) EXPECT_EQ(didCcmLeftNegativeInfinityReturnNan, didStdLeftNegativeInfinityReturnNan); EXPECT_EQ(get_ccm_quo(-std::numeric_limits::infinity(), 2.0), get_std_quo(-std::numeric_limits::infinity(), 2.0)); - - // Test with NaN bool isCcmLeftNanNegative = (std::signbit(get_ccm_rem(std::numeric_limits::quiet_NaN(), 2.0)) == true && std::isnan(get_ccm_rem(std::numeric_limits::quiet_NaN(), 2.0)) == true); // NOLINT bool isStdLeftNanNegative = (std::signbit(get_std_rem(std::numeric_limits::quiet_NaN(), 2.0)) == true && std::isnan(get_std_rem(std::numeric_limits::quiet_NaN(), 2.0)) == true); // NOLINT @@ -101,5 +98,5 @@ TEST(CcmathBasicTests, Remquo) EXPECT_EQ(didCcmLeftNegativeNanReturnNan, didStdLeftNegativeNanReturnNan); EXPECT_EQ(get_ccm_quo(-std::numeric_limits::quiet_NaN(), 2.0), get_std_quo(-std::numeric_limits::quiet_NaN(), 2.0)); - + // TODO: Add more test cases for remquo. }