Thread: Math Gone Wrong
View Single Post
  #6   Spotlight this post!  
Unread 22-01-2005, 11:03
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: Math Gone Wrong

To clear up the confusion here, the standard C types have the following ranges:
char: 2^8 (256)
int: 2^16 (65536)
long: 2^32 (4294967296)

The unsigned variety go 0 to (range-1)
The signed go from (-(range/2)) to ((range/2)-1)

Just a FYI
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!