I have branched all the fixed point maths stuff from the Native SDK to make a cross-platform library. It should work on all platforms since it's only requirements are 32-bit arithmetic (64 for multiplication) and <stdint.h>.

It's been tested and worked flawlessly on Win32, Linux x86 and the Dingoo with no compile warnings.

It is currently used widely throughout FGL (my unreleased fixed point graphics library) for transformations, so it is fairly well optimized. It is also used for all the maths in AstroLander.

As a quick overview, it provides the following functions:

Mul/Div: mul, div, lerp16

Saturated Arithmetic: sadd, smul, sdiv

Trigonometry: sin, cos, tan, asin, acos, atan, atan2

Misc.: sqrt, log2

This is as always and open-source project and the project page can be found here:

http://code.google.com/p/libfixmathHope some of you find this useful. See, us native types aren't pure evil