File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ run github_issue_799.cpp ;
5454run github_issue_802.cpp ;
5555run github_issue_805.cpp ;
5656run github_issue_808.cpp ;
57+ run github_issue_900.cpp ;
5758run link_1.cpp link_2.cpp link_3.cpp ;
5859run quick.cpp ;
5960run 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+ #include < boost/decimal.hpp>
6+ #include < boost/core/lightweight_test.hpp>
7+
8+ using namespace boost ::decimal;
9+
10+ template <typename Dec>
11+ void to_chars_helper ()
12+ {
13+ const Dec default_value;
14+ char buffer[64 ];
15+
16+ const auto r = to_chars (buffer, buffer + sizeof (buffer), default_value);
17+
18+ if (BOOST_TEST (r))
19+ {
20+ *r.ptr = ' \0 ' ;
21+ BOOST_TEST_CSTR_EQ (buffer, " 0.0e+00" );
22+ }
23+ }
24+
25+ int main ()
26+ {
27+ to_chars_helper<decimal32>();
28+ to_chars_helper<decimal64>();
29+ to_chars_helper<decimal128>();
30+
31+ to_chars_helper<decimal32_fast>();
32+ to_chars_helper<decimal64_fast>();
33+ to_chars_helper<decimal128_fast>();
34+
35+ return boost::report_errors ();
36+ }
You can’t perform that action at this time.
0 commit comments