[Issue 9061] BigInt | BigInt, BigInt & int

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 7 10:31:10 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=9061



--- Comment #8 from bearophile_hugs at eml.cc 2013-11-07 10:31:08 PST ---
Python has a library to use the very efficient GNU MP library:
http://code.google.com/p/gmpy/

The results are the same (mpz is the multiprecision integer of MP):

>>> from gmpy import mpz
>>> a = mpz(0xB16B16B16B16B16B16B16B16B16)
>>> b = mpz(4)
>>> c = a & ~b
>>> c
mpz(224904433524448119807227542465298L)
>>> c == mpz(0xB16B16B16B16B16B16B16B16B12)
True

>>> a = mpz(0xB16B16B16B16B16B16B16B16B16)
>>> b = mpz(4)
>>> c = a & b
>>> c
mpz(4)
>>> ~b
mpz(-5)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list