
11 Jan
2009
11 Jan
'09
1:58 p.m.
(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. Kevin