
On Wed, 2 Aug 2006 14:11:20 +0100, "Paul A Bristow" <pbristow@hetp.u-net.com> wrote:
But this is STILL the WRONG formula for the number of digits!
It should be max_digits10.
stream.precision(2 + std::numeric_limits<Source>::digits * 301/1000);
PLEASE can we get at long last get this right so that floats can be serialized without losing a few bits.
I presume lexical_cast will be totally rewritten not too far in the future, to optimize some specific conversions, as also recently discussed. That's why I've tended to postpone issues about it. But if you really feel strongly about this specific problem (please, say "I do so swear" ;-)) I'll give it a thought. But...: are you serializing floating point values by means of lexical_cast? -- [ Gennaro Prota, C++ developer for hire ]