Boost logo

Boost :

Subject: Re: [boost] [mp_int] Incorrect comparison with native types
From: Kevin Sopp (baraclese_at_[hidden])
Date: 2009-01-11 08:58:33

> (2)
> mp_int<> a = 13;
> int b = -1;
> cout << (a | b) << endl; // Should be -1, right?

No, -13 is the correct answer here. You're ORing the magnitude of both
numbers when using mp_ints. Unlike the built in integral types for
which the answer depends on the internal binary representation of
numbers (usually it's two's complement).

I fixed the other bugs now.


Boost list run by bdawes at, gregod at, cpdaniel at, john at