Boost logo

Boost Users :

Subject: [Boost-users] boost/multiprecision/float128
From: Cooper, Bridgette R D (b.cooper_at_[hidden])
Date: 2016-04-30 07:32:09


I'm new to boost. I am trying to use the float128 type for calculating sqrts as a larger part of code, however I am not sure the values obtained are accurate to float128 precision. I have tried running the example for printing log(2) found here, I find the same for sqrt:

http://www.boost.org/doc/libs/1_57_0/libs/multiprecision/doc/html/boost_multiprecision/tut/floats/float128.html

However, the value printed log(2) only agrees to 16 decimal places, i.e. double precision. The value I obtain is

0.693147180559945286226763982995180413 rather than 0.693147180559945309417232121458176575

I'm using:

g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15) with boost 1.57.0.

Any advice as to what I am doing incorrectly?

My compile line is:

g++ -I ~/$BOOSTLIB new.cpp -lquadmath -o new

Thanks,



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net