https://github.com/cxw42/fixedptc-fork
Fork of fixedptc by Ivan Voras
https://github.com/cxw42/fixedptc-fork
embedded embedded-c fixed-point math
Last synced: about 1 year ago
JSON representation
Fork of fixedptc by Ivan Voras
- Host: GitHub
- URL: https://github.com/cxw42/fixedptc-fork
- Owner: cxw42
- License: other
- Created: 2020-06-18T17:45:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T00:21:29.000Z (almost 6 years ago)
- Last Synced: 2025-03-28T03:05:23.854Z (over 1 year ago)
- Topics: embedded, embedded-c, fixed-point, math
- Language: C
- Homepage: https://sourceforge.net/projects/fixedptc/
- Size: 71.3 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.txt
- License: LICENSE
Awesome Lists containing this project
README
fixedptc library - a simple fixed point math header library for C.
Copyright (c) 2010-2012, 2020 Ivan Voras and contributors.
Released under the BSD license.
Single-File Library
===================
fixedptc is intended to be simple to use and integrate in other simple
programs, thus is it implemented as a C header-only library. By default, all
functions are inlined. This makes the library easy to use, but can result in a
significant increase in code size for the final executable compared to
a separately-compiled library.
Separate Compilation
====================
If the complex functions are used often in the end-program, the library should
be implemented in a separate C file. To do so:
1. Create a new C file with the text:
#define FIXEDPTC_IMPLEMENTATION
#include "fixedptc.h"
2. Add the new C file to be linked into your project.
3. In each file that uses fixedptc.h,
#define FIXEDPTC_EXTERN
#include "fixedptc.h"
EXPORT_SYMBOL
=============
If an EXPORT_SYMBOL macro is defined before the #include that pulls in the
implementation of fixedptc (FIXEDPTC_IMPLEMENTATION), that macro will be
invoked for each fixedpt function as:
EXPORT_SYMBOL(function_name);
This feature is designed to ease integration with the Linux kernel.