Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
libfixmath
Platform-independent fixed point math software

libfixmath is a platform-independent fixed-point math library aimed at developers wanting to perform fast non-integer math on platforms lacking a (or with a low performance) FPU. It offers developers a similar interface to the standard math.h functions for use on Q16.16 fixed-point numbers. libfixmath has no external dependencies other than stdint.h and a compiler which supports 64-bit integer arithmetic (such as GCC). Conditional compilation options exist to remove the requirement for a 64-bit capable compiler as many compilers for microcontrollers and DSPs do not support 64-bit arithmetic.

We don't have any images related to libfixmath yet.
We don't have any YouTube videos related to libfixmath yet.
We don't have any PDF documents related to libfixmath yet.
We don't have any Books related to libfixmath yet.
We don't have any archived web articles related to libfixmath yet.

History

libfixmath was developed by Ben Brewer and first released publicly as part of the Dingoo SDK.3 It has since been used to implement a software 3D graphics library called FGL.4

Q16.16 functions

NameDescription
fix16_acosinverse cosine
fix16_asininverse sine
fix16_atanone-parameter inverse tangent
fix16_atan2two-parameter inverse tangent
fix16_coscosine
fix16_expexponential function
fix16_sinsine
fix16_sqrtsquare root
fix16_tantangent
fix16_mulmultiplication
fix16_divdivision
fix16_saddsaturated addition
fix16_smulsaturated multiplication
fix16_sdivsaturated division

Other functions

NameDescription
fix16_to_dblConvert Q16.16 to a double
fix16_to_floatConvert Q16.16 to a float
fix16_to_intConvert Q16.16 to an integer
fix16_from_dblConvert double to a Q16.16
fix16_from_floatConvert float to a Q16.16
fix16_from_intConvert integer to a Q16.16

Performance

For the most intensive function (atan2) benchmark results show the following results:

NameTime Compared to Float
ARM Cortex-M026.3%
Marvell PXA270 (ARM) @ 312 MHz58.45%
Intel T5500120%
Intel Atom N280141%

Note: These results were calculated using fixtest with caching optimizations turned off.5

Licensing

libfixmath is released under the MIT License, a permissive free software licence, and is free software.

See also

  • Free Software portal

References

  1. "libfixmath Project Page". GitHub. https://github.com/PetteriAimonen/libfixmath

  2. "64-bit Compiler Support Issues". https://code.google.com/p/libfixmath/issues/detail?id=4

  3. "Dingoo SDK Project Page". https://code.google.com/p/dingoo-sdk

  4. "FGL Flatmush/Fixed-Point Graphics Library Project Page". https://code.google.com/p/fgl

  5. "fixtest Download Page". https://code.google.com/p/libfixmath/downloads/detail?name=fixtest_r16.zip