Boost logo

Boost :

From: Jerry Schwarz (jerry_at_[hidden])
Date: 2005-11-18 16:08:43

>I don't think XML/text archives should attempt to guarantee that
>floating point types that are denormalized or inf or nan, in any form,
>are to-the-bit identical after a trip through one of the the
>serialization library's text archives (and it should guarantee only
>that zero is still zero). It's a text archive, you get a text
>representation, and there is no standard for text representations of
>wacky floating-point types. Fullstop.
>One reason you would want to write an XML archive is to be able to
>play with it with tools independent of boost::serialization. This
>means you will need to be able to understand the text representations,
>and since no standard exists, the representation may not be too
>complicated, as that would be a hassle maintenance wise.
Actually, there is a standard for floats in XML. See Of course this doesn't mean
that any particular C++ implementation is able to support these values,
but it does suggest the way to represent them in XML files when the
implementation does support them.

Incidentally I recommend the Clinger paper referenced there to anyone
interested in external representation of floating point types. I also
recommend The Steele et. al. paper referenced at the end of the Clinger

Boost list run by bdawes at, gregod at, cpdaniel at, john at