Bit flip only function?

Pedro Gimeno gmpdevel at formauri.es
Sun Jul 20 14:46:37 UTC 2014


Viktor Kletzhändler wrote, On 2014-07-20 12:47:
> 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)?

Yes. That operator performs the one's complement of the operand. In GMP
that function is performed by mpz_com; see manual on usage.



More information about the gmp-discuss mailing list