~ 1 = -2 ???

Les Schaffer godzilla at netmeg.net
Thu Nov 4 23:01:22 EST 1999


i am doing some bit operations, and dont understand the following:

>>> ~ 1
-2

huh???? i would have thought that bitwise invert of 1 would be

0001 --> 1110 = 13 (base 10)

what marble am i missing?

les schaffer




More information about the Python-list mailing list