The line:
casts it as floating point. If you haven't used floating point math, you have your research cut out for you.Code:x = 1.0 + x / 256.0;
The line:
casts it as floating point. If you haven't used floating point math, you have your research cut out for you.Code:x = 1.0 + x / 256.0;
Just create lookup table, with linear interpolation.
I found it to be simplest and fastest way.
I successfully created this function https://en.wikipedia.org/wiki/Mean_kinetic_temperature (second function)
Using only 2 lookup tables, and linear approximation.
Mel posted years ago example to create sin function with 2 decimal places, using only integer numbers.
Bookmarks