Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] XML: float format is scientific instead of human-readable since Boost 1.57
From: Robert Ramey (ramey_at_[hidden])
Date: 2015-01-28 10:16:48


Frank Stähr wrote
> I compiled it with VS 2013 for 32 bit. The output file has the line:
> <m_accuracy>
> 2.99999999999999990e-002
> </m_accuracy>
> In Boost 1.55 it was much better human-readable: 0.03.
>
> Is this behaviour (this change) intended? In any case, what is the best
> way to format floats and doubles? (i. e. a manipulator for the of stream?)

This is surely an unintended side effect of changes to guarantee correct
"round tripping"
of floating point numbers. That is that the the floating point number read
in is bit for bit
the same as the floating point number written out.

This was seen as good thing. I'm not sure if this creates some unintended
problems.

Robert Ramey

--
View this message in context: http://boost.2283326.n4.nabble.com/Serialization-XML-float-format-is-scientific-instead-of-human-readable-since-Boost-1-57-tp4671751p4671759.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net