Opened 9 years ago
Closed 9 years ago
#8670 closed Bugs (fixed)
Bug in handling 0 mod n
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | multiprecision |
| Version: | Boost 1.53.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
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;
}
Note:
See TracTickets
for help on using tickets.

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