View Single Post
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-03-2010 , 23:31   Re: [NATIVE] Player AirAccelerate
Reply With Quote #31

Quote:
Originally Posted by ehha View Post
Both signed and unsigned should hold the same amount of numbers, in you example, signed holds 2x.
Wow. You are so wrong with your math, but the logic is right.

Quote:
For n-bit signed integers, it is -(2^(n-1)) to (2^(n-1)-1).
For n-bit unsigned integers, it is 0 to (2^n-1).
For example, if n = 8 for 8bit integers.

signed = -(2^(8-1)) to (2^(8-1)-1) = -(2^7) to (2^7-1) = -128 to 127
unsigned = 0 to (2^8-1) = 0 to 255

127 - (-128) = 127 + 128 = 255
255 - 0 = 255
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline