
13 Jan
2009
13 Jan
'09
2:11 p.m.
The interpretation of OR that you describe is consistent with libtommath (of course) but not with other arbitrary-precision-integer packages that I have tried. When I try either 13 OR -1 or (BIG(1) << 200) | -1, I get -1 from all of the following:
gmp java.math.BigInteger Python's built-in long type Ruby's built-in Bignum type
Likewise, all of these give me -14 for (BIG(13) ^ -1), while libtommath and mp_int give -12.
Are you trying to say that you prefer the behavior of the other libraries?