~ bit-wise unary operator

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Thu Sep 27 00:53:43 EDT 2007


In message <87r6klm5fk.fsf at mulj.homelinux.net>, Hrvoje Niksic wrote:

> If you want 16-bit unsigned arithmetic, use 2**16 + ~a, which yields
> 57557.

Or why not use "0xffff ^ a", which returns the same thing.



More information about the Python-list mailing list