
I have reported this as a bug to Microsoft http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=c 1f1ea71-2f7b-4ac1-b75b-68370c367aae aka http://tinyurl.com/rvp4j with the following reply: "Resolved as By Design by Microsoft on 2006-04-19 at 13:50:29 Thanks for the report. We don't agree with the premise of your bug. Because of the imprecise nature of floating point, exact comparisions are never appropriate. Round-tripping through all the machinery of input and output passes through various representations, and cannot be guaranteed to be identical to the original. Martyn Lovell Development Lead Visual C++ Libraries " The Standard is imprecise on this issue, but I feel it is a very poor do that such a bizarre small range of values should be wrong. Feels like an off-by-one rounding bug to me. Does anyone have the Pukker Dinkumware library and would like to carry out the same test on their version? Paul | -----Original Message----- | From: boost-bounces@lists.boost.org | [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A Bristow | Sent: 06 April 2006 17:34 | To: boost@lists.boost.org | Subject: Re: | [boost][serialization]Serialisation/deserialisationoffloating- | point values I have posted a fuller test to the vault. | | PS A possible workaround: | | std::stringstream s; | ss << scientific << output_value; | | works for all cases tried (100000000). | | This will increase the size of the XML (for exmaple) archive file, of | course, but... | | PPS I note that if you repeatedly serialize and restore then | you may get a 1 | bit creep up each time - it could build up to significant differences. | | -- | 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 | | | | |