View Single Post
  #3   Spotlight this post!  
Unread 15-01-2007, 20:29
Salik Syed Salik Syed is offline
Registered User
FRC #0701 (RoboVikes)
Team Role: Alumni
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Stanford CA.
Posts: 514
Salik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud ofSalik Syed has much to be proud of
Send a message via AIM to Salik Syed
Re: Floating Points and rounding

If you are only going up to 180 i don't see why a float is really necessary??? why not just multiply by 100? it'll still get you two digit accuracy

i.e: 180.00 = 18000

as for rounding a floating point number down to four decimals... it is not too hard to do, but why would you need to do it? it's not like reducing the number of decimal points will reduce the processing time more than the cost it takes to round the number.

I think the easiest way to round to four decimals would probably be to mask off the bits of the less significant digits using "&" and a masking variable
(look up bitwise operators)


this may also be of use to u:
http://en.wikipedia.org/wiki/IEEE_754
__________________
Team 701