1.3 |
| 16-Jul-2011 |
apb | Instead of returning an integer between 0 and 31 (scaled by 1<<24), use (0.5 + x/2 - 1/x) as an approximation to log2(x) for x from 1 to 2, and scale the input to fit this range. Now the error is always less than 0.2%.
Also add an test program, hidden behind #ifdef TEST_DTV_MATH, to print a table of expected and actual results, and the errors.
|