[mp_math_v02] Bug in assignment operator

Hi, Referring to the mp_math_v02 library in the Vault, the assignment operator of class mp_int<> does not quite behave the way it should. The following program #include <iostream> #include <boost/mp_math/mp_int.hpp> using namespace std; int main( int argc, char* argv[] ) { boost::mp_math::mp_int<> a, b(-1); a = -1; cout << a << " == " << b << endl; return 0; } produces the output -4294967295 == -1 It seems that the constructor code behaves as expected. I'm using gcc 4.3.0 on x86 Fedora 9. Cheers, Mikko

Hi Mikko, thanks for the report. It actually pointed me to a deeper problem within the integral type interaction code. Btw, there's also another bug in the to_string conversion routine in version 2. I will release a new version soon which I was going to do today, but the bug you found needs to be fixed the right way and that takes a little bit more work. Kevin
participants (2)
-
Kevin Sopp
-
Mikko Vainio