Dmitry K. wrote:
Hi.

The fmod() function is not absolutely accurate.
For example:
   fmod (1000001, 1000000) --> 9.536743e-01
   fmod (1000001, 10)      --> 1.015625e+00
The reason is too simple algorithm with float point
arithmetic usage.

fmod() is an important function. It is used in
trigonometric: sin/cos/tan .

After replacement of algorithm (to integral division)
the fmod() became absolutely exact. Speed is up
considarable. Size is increased a little (but the stack
usage is reduced).
Testing in progress...

Fantastic!

I'd rather take an accurate function over a slight increase in size any day.

--
Eric Weddington


_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to