[Boost-bugs] [Boost C++ Libraries] #13347: 4.666662/0.666666 is not equal to 7

Subject: [Boost-bugs] [Boost C++ Libraries] #13347: 4.666662/0.666666 is not equal to 7
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-18 13:47:09


#13347: 4.666662/0.666666 is not equal to 7
------------------------------+----------------------------
 Reporter: anonymous | Owner: John Maddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------------
 I expect to get 7 when I divide 4.666662/0.666666 using
 boost::multiprecision::cpp_dec_float_50 but I get false when I compare the
 result with 7. Here is the code:

 {{{
 #include <boost/multiprecision/cpp_dec_float.hpp>
 #include <iostream>

 int main()
 {
         using boost::multiprecision::cpp_dec_float_50;
         cpp_dec_float_50 left("4.666662"), right("0.666666");
         cpp_dec_float_50 div_res = left/right, correct_div_res("7");
         std::cout << std::boolalpha << (div_res == correct_div_res) <<
 std::endl;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13347>
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-12-18 13:54:23 UTC