[avr-libc-dev] fmod() accuracy

2006-01-17 Thread Dmitry K.
Hi. The fmod() function is not absolutely accurate. For example: fmod (101, 100) -- 9.536743e-01 fmod (101, 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 .

Re: [avr-libc-dev] fmod() accuracy

2006-01-17 Thread Eric Weddington
Dmitry K. wrote: Hi. The fmod() function is not absolutely accurate. For example: fmod (101, 100) -- 9.536743e-01 fmod (101, 10) -- 1.015625e+00 The reason is too simple algorithm with float point arithmetic usage. fmod() is an important function. It is used in