
| -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Janek Kozicki | Sent: 15 March 2006 12:56 | To: boost@lists.boost.org | Subject: Re: [boost] [serialization] | Serialisation/deserialisation offloating-point values | | Paul A Bristow said: (by the date of Wed, 15 Mar 2006 | 11:00:23 -0000) | | > | The problem is clearly with the *de*serialisation. | > | | > | Tracing back through the functions, this seems to be the | function (in | > | basic_text_iprimitive.hpp) that reads doubles from XML files: | > | | > | void load(T & t) | > | { | > | if(is.fail()) | > | | > | boost::throw_exception(archive_exception(archive_exception::st | > | ream_error)); | > | is >> t; | > | } | > | | > | This suggests that it is a broken feature of Microsoft's | > | operator>> for doubles read from filestreams. | | | why not just read the string, ans use boost::lexical_cast<double> ? | | -- | Janek Kozicki I fear that lexical_cast uses the same method of reading from a stringstream :-(( And that our testing of lexical_cast is insufficient to catch it. Some very rough tests of lexical_cast suggest that several percent of not very random double values fail to loopback ( 1 bit wrong), but I don't have time to work on this at present. IMO this seems a Microsoft problem/feature. Paul -- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204 mailto: pbristow@hetp.u-net.com http://www.hetp.u-net.com/index.html http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html