Actually for 16bit integers it's:
1111111111111111
(but I was making it a little shorter to 8 bit for the example ;-))
The reason is due to the way the processor does it's math
If you want a Quick Reference, open up your windows calculator and set it to scientific mode. press -1 then click the binary radio button.
you get something like:
1111111111111111111111111111111111111111111111111111111111111111
(which is 64bit)
-2 is:
1111111111111111111111111111111111111111111111111111111111111110
-3 is:
1111111111111111111111111111111111111111111111111111111111111101
The reason for this (in 8bit) is:
-1 + 1
Code:
11111111
+ 00000001
----------
[COLOR=red][b]1[/b][/color]00000000
The 1 is pushed off to the left, and since it is only 8 bits it leaves you with 00000000 or 0
so...
-1 + 1 = 0
here are a few other examples:
Code:
00000001 (1)
+ 00000001 (1)
----------
00000010 (2)
11111111 (-1)
+ 11111111 (-1)
----------
11111110 (-2)
(-2) + 5
11111110 (-2)
+ 00000101 (5)
----------
00000011 (3)
Hope this help... In one way or another...
Have Fun, Be Young... Code BASIC
-Josh
PROGRAMMER:
Red-eyed, mumbling mammal capable of conversing with inanimate objects.