How could I implement a xor operation of big integers with gmpy?

187 Views Asked by At

I want to xor two big integers. Just installed the gmpy2 library, but no mpz_xor operation anywhere. Am I missing something?

1

There are 1 best solutions below

0
On BEST ANSWER

Python has operator overloading, so they just made it ^. I would post a demo, but I only have access to gmpy 1.17, not gmpy2. Here's a code link showing the presence of an ^ overload, though.