"SK " <email@example.com> wrote in message <firstname.lastname@example.org>... > dpb <email@example.com> wrote in message <firstname.lastname@example.org>... > > On 1/19/2013 7:53 AM, dpb wrote: > > ... > > > > > > > > Scaling...[and other stuff elided for time being] > > > > > > > What happens if you were to multiply v by 100 and do the same w/ the > > input variable internal to the function before you start your loop? > > > > -- > > Thanks for the suggestion. > > Yes, I did try this, and it gives the correct result although I'm not sure I understand why. My first thought was that operations on numbers which differed only in the base 10 exponent should give results of equal accuracy. > > However, looking up the IEEE 754 floating point floating point representation. I see that the exponent is a power-of-2 exponent rather than a power-of-10. So, for example, 0.09 and 9 have very different mantissa's. Nevertheless both 0.09 and 9 do not have exact IEEE 754 representations.
False. 9 has an exact IEEE double representation. 0.09 does not ... the closest is: