Modify

Ticket #7878 (closed Bugs: fixed)

Opened 16 months ago

Last modified 16 months 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:

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

Change History

comment:1 Changed 16 months ago by Stepan Podoskin <stepik-777@…>

Here is more simple example: 0x10000000100000001 / 1.

I'm testing it on 32-bit computer.

comment:2 Changed 16 months 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 16 months ago by johnmaddock

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

View

Add a comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.