
11 Jan
2009
11 Jan
'09
5:04 a.m.
Other operations with incorrect results: (1) mp_int<> a = "0x100000000"; a = -a; cout << (a < -1) << endl; This can be fixed by changing line 228 of mp_math/mp_int/detail/integral_ops.hpp (in integral_ops_impl<..., true>::less): if (lhs.size() > q) - return false; + return lhs.sign() == -1; (2) mp_int<> a = 13; int b = -1; cout << (a | b) << endl; // Should be -1, right? Likewise for bitwise AND and XOR. -- Nathan