
15 Mar
2006
15 Mar
'06
8:42 p.m.
Note the difference between the "definition" formulae of 3010/10000 and the suggested formulae using 3030/10000. Perhaps this is on purpose, if not may explain why the tests done later in this thread wich use the 3030/10000 version had troubles? ;;peter Paul A Bristow wrote:
[...] For C++, using numeric limits,
So it is convenient instead to use the following formula which can be calculated at compile time: 2 + std::numeric_limits<double>::digits * 3010/10000;
[...] and I suggest that this should be:
os << std::setprecision(2 + std::numeric_limits<double>::digits * 3030/10000);
HTH
Paul