File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ run-fail benchmark_uint256.cpp ;
4848
4949run compare_dec128_and_fast.cpp ;
5050compile-fail concepts_test.cpp ;
51+
5152run crash_report_1.cpp ;
5253run github_issue_426.cpp ;
5354run github_issue_448.cpp ;
@@ -69,6 +70,8 @@ run github_issue_1057.cpp ;
6970compile-fail github_issue_1087.cpp ;
7071run github_issue_1091.cpp ;
7172run github_issue_1094.cpp ;
73+ run github_issue_1112.cpp ;
74+
7275run link_1.cpp link_2.cpp link_3.cpp ;
7376run quick.cpp ;
7477run random_decimal32_comp.cpp ;
Original file line number Diff line number Diff line change 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/1112
6+
7+ #include < boost/decimal.hpp>
8+ #include < boost/core/lightweight_test.hpp>
9+
10+ using namespace boost ::decimal;
11+
12+ template <typename T>
13+ void reproducer ()
14+ {
15+ const auto dec_res {static_cast <int >(nearbyint (T{2325 , -1 }))};
16+ const auto dbl_res {static_cast <int >(std::nearbyint (232.5 ))};
17+ BOOST_TEST_EQ (dec_res, dbl_res);
18+ }
19+
20+ int main ()
21+ {
22+ reproducer<decimal32_t >();
23+ reproducer<decimal64_t >();
24+ reproducer<decimal128_t >();
25+
26+ return boost::report_errors ();
27+ }
You can’t perform that action at this time.
0 commit comments