Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-04-05 11:53:19


Apologies - this test does NOT fail for me - that will teach me to actually
run things before I post.

I get failures with random doubles, but I can't reproduce the fault simply
like this.

I am looking into this further, but I smell wild geese.

Sorry.

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_at_[hidden]  http://www.hetp.u-net.com/index.html
http://www.hetp.u-net.com/Paul%20A%20Bristow%20info.html
| -----Original Message-----
| From: boost-bounces_at_[hidden] 
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Paul A Bristow
| Sent: 05 April 2006 10:32
| To: boost_at_[hidden]
| Subject: Re: [boost] [serialization] 
| Serialisation/deserialisationoffloating-point values
| 
| A quick test shows the problem:
| 
| #include <iostream>
| #include <sstream>
| #include <cassert>
| 
| int main ()
| {
|     std::stringstream stream;
|     double orig_value = 0.0019075645054089487;
|     stream.precision(17); // max_digits10 for double
|     stream << orig_value; // write out.
|     double num;
|     stream >> num; // read back
|     assert (num == orig_value); // should be the same!
| }
| 
| and my test program explores it more fully - mail me for a copy.
| 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk