Subject: [Boost-bugs] [Boost C++ Libraries] #11328: Regression in multiprecision::cpp_int comparison
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-21 15:43:30
#11328: Regression in multiprecision::cpp_int comparison
------------------------------+----------------------------
Reporter: chfast@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.58.0 | Severity: Regression
Keywords: |
------------------------------+----------------------------
The comparison of 2 values of different cpp_int types in the following
program produces incorrect result:
{{{#!cpp
#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+.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11328> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC