Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-04-16 20:16:15


> Ralf W. Grosse-Kunstleve wrote:

> Interesting. If I serialize and deserialize std::vector<double> as a text
> archive but on the same machine, will I always get back exactly the same
> bit patterns for the double values?

The text archive uses a stream manipulator to set the precision of the
output to capture all the precision in the double. It uses the
numeric<limits> to determine this. So I can't say it will be exactly the
same bit stream but it will be close to the original number. If you want to
guarantee the exact representation you can either use the included native
binary archive or serialize the data element (double) as a (non-portable)
binary object.

Robert Ramey


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