#11328 closed Bugs (fixed)
Regression in multiprecision::cpp_int comparison
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | Boost 1.59.0 | Component: | multiprecision |
Version: | Boost 1.58.0 | Severity: | Regression |
Keywords: | Cc: |
Description
The comparison of 2 values of different cpp_int types in the following program produces incorrect result:
#include <boost/version.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <iostream> using bigint = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>>; using u128 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<128, 128, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>; int main() { u128 a = 14; bigint b = bigint("115792089237316195423570985008687907853269984665640564039457584007913129639948"); auto correct = a < b; std::cout << "Boost " << BOOST_VERSION << " : " << correct << std::endl; return !correct; }
Versions affected: 1.58+.
Attachments (1)
Change History (5)
by , 7 years ago
Attachment: | bigint.cpp added |
---|
comment:2 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 7 years ago
Milestone: | To Be Determined → Boost 1.59.0 |
---|
How this change is going to be released? In boost 1.59?
Yes, that's the plan.
Note:
See TracTickets
for help on using tickets.
Test program