Skip to content

Gosper on twos-complement fascism

If the result loops with period = 1 with sign +, you are on a sign-magnitude machine. If the result loops with period = 1 at −1, you are on a twos-complement machine. If the result loops with period greater than 1, including the beginning, you are on a ones-complement machine. If the result loops with period greater than 1, not including the beginning, your machine isn’t binary — the pattern should tell you the base. If you run out of memory, you are on a string or bignum system. If arithmetic overflow is a fatal error, some fascist pig with a read-only mind is trying to enforce machine independence. But the very ability to trap overflow is machine dependent.

Bill Gosper

HAKMEM, MIT AI Memo 239, item 154 · c. 1972 · Gosper’s deadpan classification of number representations by their overflow behavior, concluding that the universe runs on two’s complement. · Hacking

← All quotes