Re: power() (to Rob and all)
- Posted by r.schr at t-online.de Jun 05, 2002
- 417 views
Robert Craig wrote: > ... > The C code that you posted gives the ...0033 result when it is > compiled by WATCOM using /fpc. It gives ...0000 when > it is compiled by WATCOM without /fpc, i.e. using in-line f.p. > hardware instructions. > > Therefore the little bit of fuzz after digit 14 is *due to WATCOM C*. > It has nothing to do with the way the Euphoria interpreter is coded, > therefore there is nothing I can do to "fix" it. > Aha! Thank for clearing this up! > > I wish you would be willing > > to 'repair' this! Or do you have serious reasons (I'm not aware of) why > > this could not be done? > > If someone wants to get the WATCOM open C source for pow() > and recode it so it gives 16-digit precision in this situation > instead of 14, please go ahead. > May be I should sent a note about this to the WATCOM Open Source Project? > ... > I think you, and many others on this list, expect too much of > floating-point calculations. You got lucky and found an ... Rob, I found this error when I was trying to program a general rounding routine 'round(atom a, integer n)' for -16 < n < +16 which should not only round integers but also the mantissas of fp numbers (currency calculations!). And when testing it I found this error! It's boring!! I as an astrophysicist are relying an the correct behavior of the calculations supplies by the machine! For you numbers with absolutely limited exponentials or even integers might be sufficient, for others not at all. There were long contributions here to make routines more and more perfect, but I miss this impetus in your arguments related to fp accuracy! How about the Euphoria functions like sin(), cos(), log(), ... , are these also somewhere 'fuzzy'?! But thanks a lot to clear this so far, and have anyway a nice day, Rolf