Boost C++ Libraries: Ticket #7878: Bug in integer division (assertion failed) https://svn.boost.org/trac10/ticket/7878 <pre class="wiki">boost::multiprecision::cpp_int a("79228162477370849454714781695"); a /= 0xFFFFFFFF; </pre><p> This code generates the following runtime error: </p> <pre class="wiki">Assertion failed: r.compare(y) &lt; 0, file H:\prg\boost_1_53_0_beta1/boost/multiprecision/cpp_int/divide.hpp, line 438 </pre><p> Tested on MinGW, GCC 4.7.1 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7878 Trac 1.4.3 Stepan Podoskin <stepik-777@…> Thu, 10 Jan 2013 22:40:58 GMT <link>https://svn.boost.org/trac10/ticket/7878#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7878#comment:1</guid> <description> <p> Here is more simple example: 0x10000000100000001 / 1. </p> <p> I'm testing it on 32-bit computer. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 12 Jan 2013 10:51:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7878#comment:2 https://svn.boost.org/trac10/ticket/7878#comment:2 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82460" title="Fix bug that causes division by single limb to fail when the remainder ...">[82460]</a>) Fix bug that causes division by single limb to fail when the remainder is zero and the least significant limb of the quotient is 1. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7878" title="#7878: Bugs: Bug in integer division (assertion failed) (closed: fixed)">#7878</a>. </p> Ticket John Maddock Mon, 14 Jan 2013 19:14:06 GMT <link>https://svn.boost.org/trac10/ticket/7878#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7878#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82497" title="Fix bug in cpp_int division. Update docs. Refs #7878.">[82497]</a>) Fix bug in cpp_int division. Update docs. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7878" title="#7878: Bugs: Bug in integer division (assertion failed) (closed: fixed)">#7878</a>. </p> </description> <category>Ticket</category> </item> </channel> </rss>