Commit Graph

10 Commits

Author SHA1 Message Date
Martin Bařinka 0c88e55fa8
fixed division, undefined behaviors and some improvements (#33)
* testing using ctest

* emove old testing script

* added github workflow CI

* updated CI

* added unit test for macros

* F16() and F16C() are both rounding allways, so fix16_from_dbl should as well

* added tests for strign operations, but these functions are in my opinion unreliable and tests are failing

* removed old unittests

* removed old unittests from cmake

* problem with division using gcc

* improved benchmark

* clarification of problem with division

* attempt to fix

* fixed some undefined behaviors, fixed division
2021-05-03 13:43:54 +03: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
Flatmush d9944df6d2 Added some deg/rad conversion functions.
Fixed up some code style inconsistencies.
Added a modulo function to allow optimization on 8-bit machines.
2012-07-25 09:54:58 +00:00
Petteri.Aimonen 1076285d26 Merging a bunch of separately developed functions:
fix16_mul, fix16_div, fix16_sqrt.
They are faster & more accurate than the previous versions.
Closes issue #13.

Includes unittests for the functions in question, runnable    
by typing 'make' in the unittests folder.
2012-01-26 15:43:30 +00:00
vincent.del.medico 495b0a23ad Added a fix16_sqr32 function, which computes sqrt with reduced 64-bit operations (and without any 64-bit operations by setting FIXMATH_NO_64BIT) 2011-06-11 10:03:17 +00:00
flatmush cc1e97463e Added int64.h which performs 64-bit calculations using 32-bit operations, this means that the FIXMATH_NO_64BIT macro can now be used to enable these operations on compilers without 64-bit support, note that some of these operations are slower than the built-in gcc ones (though some are faster too).
sqrt can now be compiled without 64-bit compiler support.
All remaining functions which aren't supported in 32-bit are now disabled when the FIXMATH_NO_64BIT macro is enable which should stop any compiler errors on compilers where 64-bit isn't supported.
2011-03-03 11:21:20 +00:00
flatmush 9c8a4f9aa9 Updated 32-bit division so it's now actually accurate to within 0.00065% even for non-reciprocals, the algorithm is slightly slower and slightly less accurate than the 64-bit version on my machine though.
Added 32-bit tan port using joe's atan2_complex algorithm, this is accurate to 0.0055% when used with the new 32-bit divide.
2011-03-01 15:26:37 +00:00
flatmush 5d939700e8 Fixed errors in asin/atan, where incorrect integer maths was used.
Added a macro (FIXMATH_NO_CACHE) to disable caching.
Added fix16_lerp8 and fix16_lerp32 (should be part of fract module really).
2011-02-23 09:47:08 +00:00
Flatmush 3420855dc0 Initial commit. Since its use in fgl and the Dingoo SDK the functions have been separated into more descriptive files/modules. 2011-02-14 20:59:41 +00:00