Skip to content

Commit 0956d71

Browse files
committed
Add test for 7.2.e
1 parent 2a66705 commit 0956d71

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/github_issue_1107.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ void test_add_sub()
4444
BOOST_TEST(isnan(a - a)); // inf - inf
4545
}
4646

47+
// 7.2.e
48+
template <typename T>
49+
void test_div()
50+
{
51+
const T a {dist(rng) * 0};
52+
const T b {dist(rng) * std::numeric_limits<T>::infinity()};
53+
54+
BOOST_TEST(a == 0);
55+
BOOST_TEST(isinf(b));
56+
57+
BOOST_TEST(isnan(a / a));
58+
BOOST_TEST(isnan(b / b));
59+
}
60+
4761
// 7.2.g
4862
template <typename T>
4963
void test_sqrt()
@@ -69,6 +83,13 @@ int main()
6983
test_mul<decimal_fast64_t>();
7084
test_mul<decimal_fast128_t>();
7185

86+
test_div<decimal32_t>();
87+
test_div<decimal64_t>();
88+
test_div<decimal128_t>();
89+
test_div<decimal_fast32_t>();
90+
test_div<decimal_fast64_t>();
91+
test_div<decimal_fast128_t>();
92+
7293
test_sqrt<decimal32_t>();
7394
test_sqrt<decimal64_t>();
7495
test_sqrt<decimal128_t>();

0 commit comments

Comments
 (0)