Home

Awesome

libfixmath

This is a mirror of the libfixmath's original SVN repository on Google Code.

Not actively maintained, pull requests welcome.

Libfixmath implements Q16.16 format fixed point operations in C.

License: <a href="http://www.opensource.org/licenses/mit-license.php">MIT</a>

Options

Configuration options are compile definitions that are checked by the preprocessor with #ifdef and #ifndef. All of these are undefined by default.

FIXMATH_FAST_SIN

FIXMATH_NO_64BIT

FIXMATH_NO_CACHE

FIXMATH_NO_HARD_DIVISION

Note: will be automatically defined if FIXMATH_OPTIMIZE_8BIT is defined.

FIXMATH_NO_OVERFLOW

FIXMATH_NO_ROUNDING

FIXMATH_OPTIMIZE_8BIT

Include the libfixmath library in your CMake Project

The simplest way to use libfixmath as a dependency is with CMake's FetchContent API.

include(FetchContent)
FetchContent_Declare(
    libfixmath
    GIT_REPOSITORY https://github.com/PetteriAimonen/libfixmath.git
    GIT_TAG <the long git hash of the version you want>
)
FetchContent_MakeAvailable(libfixmath)

target_compile_definitions(libfixmath PRIVATE
    # FIXMATH_FAST_SIN
    # FIXMATH_NO_64BIT
    # FIXMATH_NO_CACHE
    # FIXMATH_NO_HARD_DIVISION
    # FIXMATH_NO_OVERFLOW
    # FIXMATH_NO_ROUNDING
    # FIXMATH_OPTIMIZE_8BIT
)

target_link_libraries(my_cmake_project PRIVATE libfixmath)