TauLabs/TauLabs — pull request #476 by solidgoldbomb (2013-04-27 14:49:43+00:00)
Title: Add unit tests for sin_lookup.c

Basic unit test suite for the trig functions in sin_lookup.c.

@peabody124 it appears that these functions don't handle negative angles. By this, I mean that they will use negative numbers as indexes into the array (bad). Was that intended?

I'm not sure if it's important but couldn't these functions be made more accurate by linear interpolation between adjacent integer slots in the lookup tables? Right now, the error from these functions is fairly high as indicated by the ````eps```` value I had to choose in order to pass the tests.

To be clear, I have no intention of changing (or fixing) the implementation in this PR. This is **only** intended to add basic testcases to cover our current implementation.

@kubark42 this probably interests you as well.