Boost C++ Libraries: Ticket #13347: 4.666662/0.666666 is not equal to 7 https://svn.boost.org/trac10/ticket/13347 <p> 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: </p> <pre class="wiki">#include &lt;boost/multiprecision/cpp_dec_float.hpp&gt; #include &lt;iostream&gt; 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 &lt;&lt; std::boolalpha &lt;&lt; (div_res == correct_div_res) &lt;&lt; std::endl; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13347 Trac 1.4.3 anonymous Mon, 18 Dec 2017 13:47:49 GMT attachment set https://svn.boost.org/trac10/ticket/13347 https://svn.boost.org/trac10/ticket/13347 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> Ticket anonymous Mon, 18 Dec 2017 13:49:56 GMT <link>https://svn.boost.org/trac10/ticket/13347#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13347#comment:1</guid> <description> <p> I build the test with clang 4.0 on Ubuntu 16.04: </p> <pre class="wiki">$ clang++-4.0 -g -I ../include --std=c++1z main.cpp $ ./a.out false </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 18 Dec 2017 13:53:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13347#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13347#comment:2</guid> <description> <p> Building with --std=c++11 gives the same wrong result: </p> <pre class="wiki">$ clang++-4.0 -g -I ../include --std=c++11 main.cpp $ ./a.out false </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 18 Dec 2017 13:55:54 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/13347#comment:3 https://svn.boost.org/trac10/ticket/13347#comment:3 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.63.0</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> <p> Boost version is 1.65.1 </p> Ticket John Maddock Mon, 25 Dec 2017 16:05:04 GMT <link>https://svn.boost.org/trac10/ticket/13347#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13347#comment:4</guid> <description> <p> We know: cpp_dec_float does not perform rounding, and has internal guard digits, both of which will cause this behaviour. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 26 Dec 2017 12:01:47 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13347#comment:5 https://svn.boost.org/trac10/ticket/13347#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicates <a class="new ticket" href="https://svn.boost.org/trac10/ticket/11178" title="#11178: Bugs: cpp_dec_float calculation bug (new)">#11178</a> </p> Ticket