Re: [Boost-bugs] [Boost C++ Libraries] #9177: Improved serialization of floating point values

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9177: Improved serialization of floating point values
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-28 12:47:25

#9177: Improved serialization of floating point values
  Reporter: johnmaddock | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost Development Trunk | Severity: Problem
Resolution: fixed | Keywords:

Comment (by johnmaddock):

 Ah, just looked at your updated code and there are a number of mistakes:

 a) You mispelled my name.
 b) It uses numeric_limits<float> which will clearly only work for type
 `float` and not double, long double etc.
 c) The formula for number of digits you use is suitable for base2 only.
 d) You're still not outputting in scientific format - that results in one
 less significant digit being printed (strange but true), and as a result
 values do not always round trip.
 e) I see you also removed the save-and-restore formatting options - that
 may not matter frankly, but I thought it was a nicety to reset these at
 the end of the procedure so that classes that have their own serialize
 functions see whatever iostream flags were originally set in the stream by
 the user.

 I'm attaching a patch for these, plus to use
 numeric_limits<>::max_digits10 when available.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC