Skip to content

Commit d1daf4d

Browse files
committed
Add reproducer test set
1 parent b5789e1 commit d1daf4d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

test/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ run github_issue_1107.cpp ;
7676
run github_issue_1110.cpp ;
7777
run github_issue_1112.cpp ;
7878
run github_issue_1174.cpp ;
79+
run github_issue_1260.cpp ;
7980

8081
run link_1.cpp link_2.cpp link_3.cpp ;
8182
run quick.cpp ;

test/github_issue_1260.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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/1260
6+
7+
#include <boost/decimal.hpp>
8+
#include <boost/core/lightweight_test.hpp>
9+
10+
template <typename T>
11+
void test()
12+
{
13+
const T lhs {"1E34"};
14+
const T rhs {"-0.51"};
15+
const T res {"9999999999999999999999999999999999"};
16+
17+
const T add_val {lhs + rhs};
18+
BOOST_TEST_EQ(add_val, res);
19+
}
20+
21+
int main()
22+
{
23+
test<boost::decimal::decimal128_t>();
24+
test<boost::decimal::decimal_fast128_t>();
25+
26+
return boost::report_errors();
27+
}

0 commit comments

Comments
 (0)