
Ooops - this is a typo. It should of course be 3010/10000. (All this is because floating point calculations, especially log10(2) = 0.3010.... can't be done at compile time - a shame because it could be - and has received some consideration for the next C++0x). Sorry. Paul | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Peter Broadwell | Sent: 15 March 2006 20:43 | To: boost@lists.boost.org | Subject: Re: [boost] [serialization] | Serialisation/deserialisation offloating-point values | | 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 | > | > | > | _______________________________________________ | Unsubscribe & other changes: | http://lists.boost.org/mailman/listinfo.cgi/boost |