Libfixmath
   HOME

TheInfoList



OR:

libfixmath is a
platform-independent Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform softw ...
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 C mathematical operations are a group of functions in the standard library of the C programming language implementing basic mathematical functions. Different C standards provide different, albeit backwards-compatible, sets of functions. Most of t ...
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 In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, a ...
integer arithmetic (such as GCC). Conditional compilation options exist to remove the requirement for a
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, a ...
capable
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
as many compilers for
microcontroller A microcontroller (MC, uC, or μC) or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. Pro ...
s and DSPs do not support
64-bit In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit central processing units (CPU) and arithmetic logic units (ALU) are those that are based on processor registers, a ...
arithmetic.


History

libfixmath was developed by Ben Brewer and first released publicly as part of the
Dingoo SDK The Dingoo () is a handheld gaming console that supports music and video playback and open game development. The system features an on-board radio and recording program. It was sold to consumers in three colors: white, black, and pink. It was re ...
. It has since been used to implement a software
3D graphics 3D computer graphics, sometimes called CGI, 3D-CGI or three-dimensional computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for the purposes of perfor ...
library called FGL.


Q16.16 functions


Other functions


Performance

For the most intensive function (
atan2 In computing and mathematics, the function (mathematics), function atan2 is the 2-Argument of a function, argument arctangent. By definition, \theta = \operatorname(y, x) is the angle measure (in radians, with -\pi 0, \\ mu \arctan\left(\fr ...
) benchmark results show the following results: Note: These results were calculated using fixtest with caching optimizations turned off.


Licensing

libfixmath is released under the
MIT License The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility. Unl ...
, a
permissive free software licence A permissive software license, sometimes also called BSD-like or BSD-style license, is a free-software license which instead of copyleft protections, carries only minimal restrictions on how the software can be used, modified, and redistributed, ...
, and is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
.


See also

*
Binary scaling In computing, fixed-point is a method of representing fraction (mathematics), fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. US dollar, Dollar amounts, for example, are often stored with exactl ...
*
Fixed-point arithmetic In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. Dollar amounts, for example, are often stored with exactly two fractional digits, represen ...
*
Floating-point arithmetic In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
*
Q (number format) The Q notation is a way to specify the parameters of a binary fixed point number format. Specifically, how many bits are allocated for the integer portion, how many for the fractional portion, and whether there is a sign-bit. For example, in ...


References

{{Reflist


External links


Project Page

Group Page/Mailing List
Numerical software C (programming language) libraries Free computer libraries Free software programmed in C