Boost logo

Boost :

Subject: [boost] [mp_math_v02] Bug in assignment operator
From: Mikko Vainio (mikko.vainio_at_[hidden])
Date: 2008-10-03 02:57:27


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk