A question on the preciseness of the double used in MTL. Can anyone with kindness help me?
I am using MTL(Matrix Template Library) for Matrix computing in Dev-C++ 4.9.8.0 and updated the gcc version from 3.2 to 4.4.1 by installing tdm-mingw-1.908.0-4.4.1-2 and the boost version is 1.37.0. The system is Windows xp The sample code is :
#include
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of fmingu
Sent: Monday, March 29, 2010 1:12 AM
To: boost-users
Subject: [Boost-users] A question on the preciseness of the double used in MTL. Can anyone with kindness help me?
I am using MTL(Matrix Template Library) for Matrix computing in Dev-C++ 4.9.8.0 and updated the gcc version from 3.2 to
4.4.1 by installing tdm-mingw-1.908.0-4.4.1-2 and the boost version is 1.37.0. The system is Windows xp The sample code
is :
#include
How can I get the highest precision of the type double and dense2D<double> for scientific computation?
The highest significant precision for the floating point you are using can be got using your_stream.precision(2 + std::numeric_limits<double>::digits * 3010/10000); For the usual 64 bit doubles this is equivalent to cout << setprecision(17) ... This should every digit that might possibly be significant. Using C++0X you should be able to use std::numeric_limits<double>::maxdigits10() This is about 2 digits more than the std::numeric_limits<double>::digits10() function which is the maximum number of digits guaranteed accurate decimal digits (for 64 bit double it is 15 decimal digits). HTH Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
participants (2)
-
fmingu
-
Paul A. Bristow