|
Boost : |
From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-05-03 04:13:30
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Robert Ramey
| Sent: 02 May 2006 19:33
| To: boost_at_[hidden]
| Subject: Re:
| [boost][serialization]Serialisation/deserialisationoffloating
| -point values
|
| Could we consider removing the word "serialization" from
| this subject here? This is really about rendering floating
| point numbers between binary and decimal representations.
OK - we are veering OT - but it started with a serialization problem and I
thought a new item would confuse the thread. I think we have reached the
end of the road and await the next Microsoft release. I will start of new
thread if I have anything more to report.
Meanwhile, if you want to serialize doubles on MSVC, I suggest considering
using << setprecision(17) << scientific.
| Also, a real contribution could be made to address the
| variety of NaN's and how they should be rendered in
| different systems. This is currently undefined and will
| create problems porting data between programs compiled with
| diferent compilers and/or libraries.
Jeff Garland made a suggestion:
"The types in date_time have the ability to serialize and deserialize NADT
(not a date time), -infinity and +infinity. Why couldn't there be a simple
extension to the numpunct<charT> facet to define an appropriate output
string? Basically something like:
//see Langer and Kreft p 414...
template<class charT>
class numpunct : public locale::facet {
//new functions for nan and infinity
string_type not_a_number_name() const;
string_type infinity_name() const;
And you'd have to fix num_get as well."
but it's not something I have time or skill or inclination to tackle. SoC?
Or switch at least NaNs and Infs to a hex format as sketched by John
Maddock?
Or get WG21 to agree a Standard representation for NaNs and Infs instead of
everyone doing their own thing?
Paul
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk