In article "Androcles" Androcles@ MyPlace.org writes:
....
| Assuming 16-bit signed integers, represented in hex:
I've just used 32-but signed integers.
1-s complement or 2-s complement?
| Is 0x7fff positive or negative?
The highest positive number you can represent in 16-bit signed integer.
Right.
| Is 0x7fff+1 positive or negative?
Neither. It is zero.
Wrong. It is overflow.
| Is 0x7fff+2 positive or negative?
Positive overflow.
| Is 0x8000 positive or negative?
That was my question.
Awww....1000 0000 0000 0000 isn't -0 anymore?
It is not on 2-s complement machines, that is on almost *all* machines
currently running. It is -32768.
| It's the highest positive integer that can be crammed into
| 16 bits, given current sign conventions.
Exactly, right. Given current sign conventions, there is a -zero.
Exactly wrong. Given current sign conventions there is no -zero.
When did you retire precisely?
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland;
http://www.cwi.nl/~dik/