]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/test/git_issue_313.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright 2021 Christopher Kormanyos. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/multiprecision/cpp_dec_float.hpp>
15 using local_decfloat_type
= boost::multiprecision::cpp_dec_float_100
;
17 bool result0_is_ok
= false;
18 bool result1_is_ok
= false;
21 const local_decfloat_type test
= pow(local_decfloat_type
{2}, 30) * pow(local_decfloat_type
{10}, -3);
23 std::stringstream strm
;
25 strm
<< std::setprecision(std::numeric_limits
<local_decfloat_type
>::digits10
)
30 (strm
.str() == "1073741.8240000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
34 const local_decfloat_type
test(0.625F
);
36 std::stringstream strm
;
38 strm
<< std::setprecision(std::numeric_limits
<local_decfloat_type
>::digits10
)
43 (strm
.str() == "0.6250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
46 const bool result_is_ok
= (result0_is_ok
&& result1_is_ok
);
48 BOOST_CHECK_EQUAL(result_is_ok
, true);
55 return boost::report_errors();