Comment #2 on issue 2255 by [email protected]: Error multiplying float variables.
http://code.google.com/p/v8/issues/detail?id=2255
Just to give a short justification if anybody is too lazy to read the paper: For integers p and q with gcd(p, q) = 1, the fraction p/q has a finite representation in base b if and only if each prime factor of q is also a prime factor of b (see http://en.wikipedia.org/wiki/Base_conversion#Infinite_representations). In our case: 3/10 is periodic in base 2, because gcd(3, 10)= 1, the prime factors of 10 are 2 and 5, 2 is a prime factor of 2, but 5 is not. This means that one cannot exactly represent 3/10 in a IEEE 754 number. Often this is hidden by the rounding done during printing, but in our case it's not.
-- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
