bitwise not - not what I expected

Elaine Jackson elainejackson7355 at
Mon Aug 18 01:26:23 CEST 2003

"Michael Peuser" <mpeuser at> wrote in message
news:bhosrr$u57$06$1 at

| I have the impression (may be wrong) that you are working under the
| misconception that there can be a "natural" binary represensation of
| negative numbers!?
| Three conventions have commonly been used so far:
| 1- Complement
| 2-Complement
| Sign tag plus absolut binary values

The last alternative sounds like what I was assuming. If it is, I would argue
that it's pretty darn natural. Here's a little function to illustrate what I

def matilda(n):     ##  "my tilde"
    if 0<=n<pow(2,29):
        for i in range(1,31):
            if n<=iOnes:
                return iOnes-n

More information about the Python-list mailing list