Re: netwinder floating point
Am Donnerstag, 6. Januar 2005 21:48 schrieb Jim Buttafuoco:
> I get 2 different answers for sqrt(200). with the fastfpe giving a
> different answer from lets say i386 while the nwfte give the exact answer
> that i386 does.
I can reproduce this on my bast, so no need to reboot your netwinder. The
problem ist, that I did not implement correct rounding for the sqrt
algorithm, because this involves a bit thinking to do it correctly. So, if
you use FastFPE, the LSB of the result of an sqrt instruction can be wrong
with a chance of 50%. For most applications this is tolerable. Nevertheless,
I will correct this once I have time. Would you offer yourself as test person
for the fix once it is done?
If it is a program compiled by yourself, you can avoid the problem by using
the -O0 optimisation switch, this lets gcc not inline the sqrt instruction,
but instead call a library function which does the work by hand.