cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed point library

Kuikui
Associate III
Posted on May 31, 2011 at 11:10

Hi all,

In my project, I am using a GPS to measure some distances, and some angles combined with a magnetometer.

Therefore, I have to do a lot of floating point operations. It's dirty, it's slow, and it's taking a lot of memory.

Does anybody has already used any fixed point library ?

Can't find anything ''usefull'' with google, I wonder why ... :\

Thanks for help.

Best regards,

VDM.

4 REPLIES 4
Andrew Neil
Evangelist
Posted on May 31, 2011 at 13:30

''Can't find anything ''usefull'' with google''

 

 

Have you tried

http://codesearch.google.com/

- it's specifically for finding open-source code...

Kuikui
Associate III
Posted on May 31, 2011 at 16:51

I found this :

http://code.google.com/p/fixpointlib/

Andrew Neil
Evangelist
Posted on May 31, 2011 at 17:11

It even has test results for an STM32!

🙂

Posted on June 01, 2011 at 00:03

There also code Ivan Mellen has provided. Including a quite slick square root function.

http://www.embeddedsignals.com/

Fixed point (16:16, or whatever) is pretty basic stuff. You do however need to be careful about the precision you want, and keeping the numbers, or intermediates, in range. Even if you use someone else's library, you'd better have a very clear idea of the math, and test it throughly. At least floating point is relatively elastic.

It's certainly possible to handle some GPS stuff in integer math, especially if you have units like centimeters, and are doing relative measurements. The geoid/squashed ellipsoid representation of latitude/longitude might be a lot of fun though.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..