CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

More Floating Point Accuracy

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








More Floating Point Accuracy
PostPosted: Mon Nov 15, 2004 7:03 am     Reply with quote

I'm working with GPS data and I only get around 1000 foot resolution for distance measurements becuase of the limitations of the float. This isn't accurate enough so I'm looking for the easiest way to get more accuracy. I need trig functions so scaling doens't really work. Does anyone think it would be possible to get SoftFloat to compile? http://www.jhauser.us/arithmetic/SoftFloat.html

what have other people done to get around the inherant lack of precision in the built in float?
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

PostPosted: Mon Nov 15, 2004 8:24 am     Reply with quote

My projects involve GPS and measuring distances up to 1 mile. I use INT32 in my math up to a point where I can convert to float without loosing any significant resolution. INT32 will allow you some very large values to work with.
Guest








..
PostPosted: Thu Nov 18, 2004 5:05 am     Reply with quote

aren't floats 32bit the same as int32? how can that give higher precision?
Ttelmah
Guest







Re: ..
PostPosted: Thu Nov 18, 2004 6:03 am     Reply with quote

Anonymous wrote:
aren't floats 32bit the same as int32? how can that give higher precision?

Float, uses 23bits to actually hold the 'value', and the rest to hold the sign, and then the 'scale factor' to be applied to the value, and the sign of this. The basic 'accuracy' of a float, is only 2^23, but the key is that it can retain this over a huge range of number 'sizes'. The fixed point 32bit format, can use the whole 32bits to hold the value (or 31, assuming it is signed), so if you are working with numbers in a limited range, the fixed point arithmetic can potentially be 256* 'more accurate'. The arithmetic is also quicker.
Most people working here with this sort of data, have used integers this way.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group