Ticket #8670 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 years ago

Bug in handling 0 mod n

Reported by: filipedlarcanjo@… Owned by: johnmaddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:


The following code produces as outputs the numbers 5933326056 and 0.

#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

int main()
  typedef boost::multiprecision::checked_int1024_t bigint;
  bigint n = 5933326056;
  bigint z = 0;
  cout << (z % n) << endl;
  cout << (0 % 5933326056) << endl;


Change History

comment:1 Changed 2 years ago by johnmaddock

(In [84716]) Fix for 0 % N giving wrong answer in cpp_int. Refs #8670.

comment:2 Changed 2 years ago by johnmaddock

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

(In [84799]) Merge fixes for from Trunk. Fixes #8692. Fixes #8670. Fixes #8667.


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.