Ticket #7878 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

Bug in integer division (assertion failed)

Reported by: Stepan Podoskin <stepik-777@…> Owned by: johnmaddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.53.0 Severity: Problem
Keywords: division Cc:


boost::multiprecision::cpp_int a("79228162477370849454714781695");
a /= 0xFFFFFFFF;

This code generates the following runtime error:

Assertion failed: < 0, file H:\prg\boost_1_53_0_beta1/boost/multiprecision/cpp_int/divide.hpp, line 438

Tested on MinGW, GCC 4.7.1


Change History

comment:1 Changed 4 years ago by Stepan Podoskin <stepik-777@…>

Here is more simple example: 0x10000000100000001 / 1.

I'm testing it on 32-bit computer.

comment:2 Changed 4 years ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

(In [82460]) 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 #7878.

comment:3 Changed 4 years ago by johnmaddock

(In [82497]) Fix bug in cpp_int division. Update docs. Refs #7878.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.