Re: [Boost-bugs] [Boost C++ Libraries] #12327: cpp_rational::convert_to<double>() does not return the nearest number

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12327: cpp_rational::convert_to<double>() does not return the nearest number
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-07-25 18:17:56


#12327: cpp_rational::convert_to<double>() does not return the nearest number
---------------------------+----------------------------
  Reporter: komakisen@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: Boost 1.62.0 | Component: multiprecision
   Version: Boost 1.61.0 | Severity: Problem
Resolution: fixed | Keywords:
---------------------------+----------------------------
Changes (by johnmaddock):

 * status: new => closed
 * resolution: => fixed
 * milestone: To Be Determined => Boost 1.62.0

Comment:

 You're correct, I was the one confused!

 Fixed in
 https://github.com/boostorg/multiprecision/commit/7ebd9dfd9b0bc463642b065036a3cd6947a74431.

 However, your second test case still fails testing rd12, in this case I
 *think* the bug is yours: r12 is

 {{{14411518807585589/144115188075855872}}}

  which in binary is exactly the 54 bit quantity:

 {{{0.000 1100110011 0011001100 1100110011 0011001100 1100110011 010 1
                                                        rounded here ^
 }}}

 And in this case no rounding up occurs since we have a tie and round to
 even.

 Please do correct me and re-open if I'm wrong! :)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12327#comment:3>
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:20 UTC