
| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Gennaro Prota | Sent: 02 August 2006 19:34 | To: boost@lists.boost.org | Subject: Re: [boost] Spurious warning in lexical_cast.hpp | | 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? No - I meant 'stringizing' - but the same wrong formula has been used for serialization. Fortunately it just happens to give the right result for double - and most people are using that. But as a QOI issue, I think it looks bad, and may bite some poor unsuspecting user. Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com