Thread: Math Gone Wrong
View Single Post
  #5   Spotlight this post!  
Unread 22-01-2005, 09:40
psquared psquared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Chantilly
Posts: 34
psquared is an unknown quantity at this point
Re: Math Gone Wrong

Quote:
p1_x is an unsigned char and can only hold a value equal to 0-255.
Therefore it cannot hold 256, 400, or 500 in the above example.
could you explain. We are not trying to make p1_x greater than 255, we are just trying to use it to make an int greater than 255...

value = (2)*(p1_x)+256;

I would think that is ok, but if not, how could we correct it to get the same result.


thanks.