Bit flip only function?

Viktor Kletzhändler vkletzhaendler at
Sun Jul 20 10:47:01 UTC 2014


The mpz_ logical and bit manipulation functions all seem to work on two's complement representations (as indicated in the manual). This is also true for the respective mpn_ functions, as far as I can see.

Is there an efficient "bit flip only" function (equivalent to the ~ operator)?

If not, is the attached code safe? It seems to work, and will run solely on 64-bit platforms. 

Thanks for advise

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bit_flip_code.txt
URL: <>
-------------- next part --------------

More information about the gmp-discuss mailing list