|
From: Daniel J S. <dan...@ie...> - 2007-04-09 03:12:07
|
Ethan A Merritt wrote: > Note that 2147483648.0, although a large number in absolute terms, corresponds > to an error in the 15th decimal place of the decimal representation of 10^25. > More to the point, that corresponds to about 50 bits of precision. > Since double-precision IEEE format only provides 52 bits of precision in the > mantissa, this is within one bit of the expected rounding error. > (And that one bit may be my mistake; I'm doing this on my fingers, as it were). Right, the example powint(base,power) = power==0 ? 1.0 : base * powint(base,power - 1) powdiff(base,power) = (base**power / powint(base,power)) - 1.0 set samples 61 ; plot [0:60] powdiff(10,x) suggests that. I guess my feeling is to not discount the pow() function off hand, unless someone has seen some awful implementations out there. It is a standard library function, you'd think designers would put effort into its accuracy and users would complain otherwise. Dan |