On 30/04/2016 18:38, Cooper, Bridgette R D wrote:
Hi Paul,
For a moment I thought that worked. It certainly does for log(2). I distinctly get two different values (with the first giving the "correct" value) if I try:
std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << log(float128(2.q)) << std::endl;
std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << log(2.q) << std::endl;
However, this isn't true for sqrt still. I checked by calculating the sqrt(pi) and comparing to
https://github.com/ned14/boost-trunk/blob/master/libs/multiprecision/test/te...
std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << sqrt(float128(pie)) << std::endl;
std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << sqrt(pie) << std::endl;
These two lines give me identical results and again only match the first 16 digits.
pie is defined as float128 and I copy/pasted the 100 digit value from the same test_sqrt.cpp given above.
I suspect an error in your declaration of pie, using this: using namespace boost::multiprecision; __float128 pie = boost::math::constants::pi<__float128>(); std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << sqrt(float128(pie)) << std::endl; std::cout << std::setprecision(std::numeric_limits<float128>::max_digits10) << sqrt(pie) << std::endl; I see as output: 1.77245385090551602729816748334114514 1.77245385090551588191942755656782538 John.