Commit Graph

123 Commits

Author SHA1 Message Date
Thea Flowers 9a5a33c8cb Add AUTHORS file 2021-01-22 14:26:00 -05:00
Stargirl Flowers 579f60511f
Add LICENSE
This library is wonderful, however, it's missing an explicit license in its source code. This adds the text of the MIT license along with the name of the original author. This helps folks like me make sure we follow the license terms when using this library. :)
2021-01-21 15:26:19 -05:00
Petteri Aimonen 83c5f4438e
Merge pull request #21 from HamAndChris/fix_linear_interpolation
Removed 64-bit restriction on linear interpolation functions, fixed int64 bugs
2020-10-29 21:23:07 +02:00
Chris Hammond 18a9ad00de Removed 64-bit restriction on linear interpolation functions. Added more test cases and fixed several bugs in the 64-bit arithmetic functions.
Also added script to run all unit tests.
2020-10-29 13:20:27 -04:00
Petteri Aimonen 54c1f9276a
Merge pull request #20 from HamAndChris/fix_linear_interpolation
Fix type conversion bugs in linear interpolation functions
2020-10-23 08:22:13 +03:00
Chris Hammond 2859cbf31d Added unit tests for "lerp" functions, and found several type conversion bugs 2020-10-22 16:24:49 -04:00
Petteri Aimonen 66365d5888
Merge pull request #16 from althonos/patch-1
Fix GCC error when compiling in no-overflow mode
2020-03-15 06:53:22 +02:00
Martin Larralde 950d51759b
Fix `elif` without condition in `fix16_trig.c` 2020-03-15 02:22:25 +01:00
Petteri Aimonen 20a2d64bb8
Merge pull request #15 from dlech/patch-1
add #include <stdint.h> to int64.h
2019-12-13 08:17:21 +02:00
David Lechner d09f7a4396
add #include <stdint.h> to int64.h
When using the `gcc -M` option to determine header file dependencies, int64.h causes an error because the types from stdint.h are not defined.
2019-12-12 17:02:53 -06:00
Petteri Aimonen c3017d7d74
Merge pull request #13 from althonos/patch-1
Fix missing function when building without overflow support
2019-09-08 21:35:57 +03:00
Martin Larralde 6f6284807f
Fix missing function when building without overflow support 2019-09-08 15:28:05 +02:00
Petteri Aimonen fd01d546a9
Merge pull request #12 from dlech/master
Fixes
2019-06-17 09:17:19 +03:00
David Lechner 11855068c3 Fix conflict with __int64_t typedef
On Linux, we get a compile error because __int64_t is defined and
included by stdint.h. Double underscores are reseved in C in general
and should not be used anyway. Replace with a single leading underscore.
2019-06-16 15:38:23 -05:00
David Lechner ff0a5f69c2 add FIXMATH_NO_CTYPE option
When compiling with -nostdlib, the functions in ctype may not be
available. Add FIXMATH_NO_CTYPE option to replace them with inline
functions.

Also add unit test to test str functions with this option enabled.
2019-06-16 15:38:19 -05:00
David Lechner 108fd93a34 clean all unit tests
make clean should delete all unit test binary files
2019-06-16 15:37:41 -05:00
David Lechner 3b7f96f982 Add explicit cast in fix16_from_dbl()
This fixes the error:

    implicit conversion from 'float' to 'double' to match other operand
    of binary expression

When the compiler options -fsingle-precision-constant -Wdouble-promotion
are set
2019-06-16 15:19:01 -05:00
Petteri Aimonen 47a5aa74ff
Merge pull request #10 from puzrin/patch-1
Suppress `-Wconversion` warning
2019-04-15 09:14:33 +03:00
Vitaly Puzrin f13c322287
Suppress `-Wconversion` warning 2019-04-15 02:29:08 +03:00
Petteri Aimonen bada934981
Merge pull request #9 from puzrin/patch-1
platformio: drop 'export' option from config
2018-07-27 15:53:53 +03:00
Vitaly Puzrin f1d95c94df
platformio: drop 'export' option from config
Library should be useable from pio both by direct git link and by name.
2018-07-27 14:54:22 +03:00
Petteri Aimonen 7dbe4b984b
Merge pull request #8 from puzrin/master
Update pio manifest to satisfy registry add rules
2018-07-24 15:06:30 +03:00
Vitaly Puzrin c0e66997db
Update pio manifest to satisfy registry add rules 2018-07-24 14:59:00 +03:00
Petteri Aimonen dd8da476c7
Merge pull request #6 from puzrin/master
Add library config for PlatformIO
2018-07-24 14:16:02 +03:00
Vitaly Puzrin ad66a42562 Add library config for PlatformIO 2018-07-24 14:00:19 +03:00
Petteri Aimonen 7f9c966b5c Merge pull request #4 from cladmi/pr/libfixmath/gcc6
Fix '-Werror=shift-negative-value' for gcc 6
2017-09-28 18:58:34 +03:00
Gaëtan Harter f8596fbada Fix '-Werror=shift-negative-value' for gcc 6
GCC 6 introduced warning for shift on negative value numbers.
When F16C is called with a negative number it evaluates FIXMATH_COMBINE_I_M
with both the positive and the negative value.

Fixes #3
2017-09-28 17:06:54 +02:00
Petteri Aimonen 6928e2f76d Merge pull request #2 from xli2012/const
make some member functions const
2017-08-09 07:15:28 +03:00
Xin Li a2784ee999 make some member functions const 2017-08-08 13:54:48 -07:00
Petteri Aimonen ad9ed940e5 Add license info, as originally on Google Code. 2015-07-07 10:41:09 +03:00
Petteri Aimonen 6d4ced1f8f Create README.md 2015-07-07 10:38:13 +03:00
PetteriAimonen cbbfe85a4a Add F16C() macro for defining values without float support.
Implementation by Jonas Zeiger.
2014-12-30 18:41:55 +00:00
PetteriAimonen 516f37428b Fix typo in benchmark.c. 2014-12-30 18:41:00 +00:00
PetteriAimonen bffee79f7f Fix compile error on GCC 2014-01-16 19:15:34 +00:00
PetteriAimonen 6758096516 Fix errors on Visual Studio (patch by sunside227) 2014-01-16 06:21:59 +00:00
PetteriAimonen 66dcaddf68 Fix bug in fix16_str_unittests on Windows.
Fixes issue 23.
2013-04-19 19:36:49 +00:00
PetteriAimonen b22e67fbf0 Fix bug in the fix16_fft example 2013-02-17 08:12:25 +00:00
PetteriAimonen 6d59de5d60 Add #ifndefs around sdiv/smul/sadd/ssub in the C++ interface.
Closes issue #19.
2013-01-28 15:56:00 +00:00
PetteriAimonen bf4299bf58 Fix error in fix16_lerp16 on platforms with sizeof(int) == 2.
Patch by georgjohann. Closes issue 20.
2013-01-28 15:52:08 +00:00
PetteriAimonen 52214f192f Use >= comparison in fix16_sadd, fix16_ssub.
Patch submitted by georgjohann.
Closes issue #21.
2013-01-28 15:49:07 +00:00
Flatmush b474bff626 Fixed erronous printout of division unit test. 2012-08-31 10:35:15 +00:00
Petteri.Aimonen a3ad27ed10 Fix a division bug on 64-bit platforms.
The GCC builtin clzl depends on the sizeof(long), which
caused an error if it was other than 32 bits.

Fixes issue #17.
2012-08-31 10:16:09 +00:00
Petteri.Aimonen 10af3a6c60 Add shorthand macro F16() for defining numeric constants 2012-08-30 16:52:52 +00:00
Petteri.Aimonen 0bec62409b Edited wiki page FunctionReference through web user interface. 2012-08-29 15:00:42 +00:00
Petteri.Aimonen 543e39f42d Added to/from string conversion functions, and testcases for them. 2012-08-29 14:38:36 +00:00
Petteri.Aimonen cb1744b886 Perform the fix16_min -> fix16_minimum rename in unittests to make them work again. 2012-08-29 13:10:52 +00:00
Petteri.Aimonen 4ffed9b5ff Const allows more optimizations than pure 2012-08-05 16:16:12 +00:00
Petteri.Aimonen 40ef134f4d Add fix16_sq() inline function as a shorthand to square values 2012-08-05 16:11:40 +00:00
Flatmush 85204f4a28 Updated coding style document.
Cleaned up some code.
2012-07-25 14:49:11 +00:00
Flatmush bc77d6a360 Added basic code style document to project. 2012-07-25 11:18:25 +00:00