Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7878 closed Bugs (fixed)

Bug in integer division (assertion failed)

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

Description

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

This code generates the following runtime error:

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

Tested on MinGW, GCC 4.7.1

Attachments (0)

Change History (3)

comment:1 Changed 5 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 5 years ago by John Maddock

Resolution: fixed
Status: newclosed

(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 5 years ago by John Maddock

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.