Skip to content

Commit a1937d7

Browse files
committed
Add test set
1 parent bd7f040 commit a1937d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test_cmath.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,14 @@ void test_exp2()
13401340
BOOST_TEST_EQ(exp2(-std::numeric_limits<T>::infinity()), T(0 * dist(rng)));
13411341
}
13421342

1343+
template <typename T>
1344+
void test_nan()
1345+
{
1346+
BOOST_TEST(!isnan(nan<T>("1") & std::numeric_limits<T>::quiet_NaN()));
1347+
BOOST_TEST(!isnan(nan<T>("2") & std::numeric_limits<T>::quiet_NaN()));
1348+
BOOST_TEST(!isnan(nan<T>("-1") & std::numeric_limits<T>::quiet_NaN()));
1349+
}
1350+
13431351
int main()
13441352
{
13451353
test_fmax<decimal32>();
@@ -1448,5 +1456,9 @@ int main()
14481456
test_exp2<decimal32>();
14491457
test_exp2<decimal64>();
14501458

1459+
test_nan<decimal32>();
1460+
test_nan<decimal64>();
1461+
test_nan<decimal128>();
1462+
14511463
return boost::report_errors();
14521464
}

0 commit comments

Comments
 (0)