Skip to content

Commit dc9d611

Browse files
committed
Add reproducer test set
1 parent 940c360 commit dc9d611

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

test/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ run github_issue_1057.cpp ;
7070
compile-fail github_issue_1087.cpp ;
7171
run github_issue_1091.cpp ;
7272
run github_issue_1094.cpp ;
73+
run github_issue_1106.cpp ;
7374
run github_issue_1110.cpp ;
7475
run github_issue_1112.cpp ;
7576

test/github_issue_1106.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2025 Matt Borland
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// https://www.boost.org/LICENSE_1_0.txt
4+
//
5+
// See: https://github.com/cppalliance/decimal/issues/1094
6+
7+
#include <boost/decimal.hpp>
8+
#include <boost/core/lightweight_test.hpp>
9+
#include <limits>
10+
11+
using namespace boost::decimal;
12+
13+
template <typename T>
14+
void test()
15+
{
16+
const auto a {std::numeric_limits<T>::lowest() / 99};
17+
const T b {1, 2};
18+
const auto c {a * b};
19+
20+
BOOST_TEST(isinf(c));
21+
BOOST_TEST(signbit(c));
22+
}
23+
24+
int main()
25+
{
26+
test<decimal32_t>();
27+
test<decimal64_t>();
28+
test<decimal128_t>();
29+
30+
test<decimal_fast32_t>();
31+
test<decimal_fast64_t>();
32+
test<decimal_fast128_t>();
33+
34+
return boost::report_errors();
35+
}

0 commit comments

Comments
 (0)