Boost logo

Boost :

Subject: Re: [boost] [serialization] How are floating point values handled?
From: John Maddock (john_at_[hidden])
Date: 2013-08-07 13:38:13


> This actually raises a problem when using text archives with floating
> point data - if you want to be able to round trip the values, then how
> many digits precision should you set the stream to? Particularly if
> you're saving a complex structure containing different floating point
> types of differing precisions?

Let me rephrase this somewhat: if I'm the author of a complex data structure
that contains floating point data and I make it serializable, I have no way
to ensure serialization proceeds correctly: instead that burden falls on the
person creating the archive. For sure in small projects these will be the
same person, but clearly not when "library writing". And yes, I realize
that many compilers don't round trip floating point values even when you
print "enough" digits, but at least they get close. The current default
situation is to print just 5 digits, and that certainly doesn't get close!
But, rant over for now ;-)

Cheers, John.


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