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 17:31:09


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

Comment (by ramey):

 Thanks for the interesting comments.

 a) sorry about misspelling your name,

 b) I noticed that float vs double after checkin - fixed now

 c) usage of the kahan formula. In my own tests I found it didn't work.
 It seemed to me that it should work in our case given that the radix trait
 of our floating point types should be 2. If understand this correctly (
 which I doubt) the code in your patch should work the same as mine. When
 I got these results, changed to the current version you see now in the
 repository which used digits10+2. This gave results without round trip
 errors in gcc and max round trip error of 1 with mdvc 9.0.

 d) I fixed the scientific format issue.

 e) i implements save/restore state using io state saver for both the
 precision and format (scientific). This should leave the stream in the
 same state it was before. I haven't uploaded this yet.

 I used digits10 + 2. I have no problem incorporating your patch. I was
 reluctant to do this as I didn't find BOOST_NO_CXX11_NUMERIC_LIMITS in the
 1.54 documentation. I'll presume it's in the next release.

 I'll incorporate your test in the future.

 One big problem is the usage of BOOST_CHECK_EQUAL. Previously I had used
 my own ad-hoc method to test whether values were "close enough". Of
 course now that we're looking at this more carefully it became clear that
 my test wasn't really correct. I moved to your float_distance function
 which addressed these issue. I set a tolerance for 1 or 2 bits
 difference. Now I'm wondering if I should set that to zero - I'll look
 into that later. I really don't have the confidence that the wide variety
 of platforms which I would like the serialization library to target all
 have floating point correctly implemented. I'll think about this.

 Thanks for you help with all this.

 Robert Ramey

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9177#comment:8>
Boost C++ Libraries <http://www.boost.org/>
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