Skip to content

Commit 5aaa62d

Browse files
committed
Add 7.2.f test set
1 parent 6b86049 commit 5aaa62d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/github_issue_1107.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ void test_div()
5858
BOOST_TEST(isnan(b / b));
5959
}
6060

61+
// 7.2.f
62+
template <typename T>
63+
void test_remainder()
64+
{
65+
const T a {dist(rng) * 0};
66+
const T b {dist(rng) * std::numeric_limits<T>::infinity()};
67+
const T c {dist(rng)};
68+
69+
BOOST_TEST(isnan(remainder(b, c)));
70+
BOOST_TEST(isnan(remainder(c, a)));
71+
}
72+
6173
// 7.2.g
6274
template <typename T>
6375
void test_sqrt()
@@ -90,6 +102,13 @@ int main()
90102
test_div<decimal_fast64_t>();
91103
test_div<decimal_fast128_t>();
92104

105+
test_remainder<decimal32_t>();
106+
test_remainder<decimal64_t>();
107+
test_remainder<decimal128_t>();
108+
test_remainder<decimal_fast32_t>();
109+
test_remainder<decimal_fast64_t>();
110+
test_remainder<decimal_fast128_t>();
111+
93112
test_sqrt<decimal32_t>();
94113
test_sqrt<decimal64_t>();
95114
test_sqrt<decimal128_t>();

0 commit comments

Comments
 (0)