File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff 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
4862template <typename T>
4963void 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 >();
You can’t perform that action at this time.
0 commit comments