Comment #7 on issue 3035 by [email protected]: Math.sin(Math.PI) inaccurate
http://code.google.com/p/v8/issues/detail?id=3035

Every argument made about floating point and accuracy which doesn't involve the notion of ranges if basically invalid. Every floating point value does not represent a single mathematical value, but a *range* of values (because the binary digits beyond the mantisssa are unknown). If you want to argue about the accuracy of a function, you have to consider how a range of values is mapped mathematically by the (mathematical) function, and if the observed result is within that range.

In our case, the first derivative of sine at pi is 1, this means that the range of values corresponding to Math.PI is mapped to a range of the same size around the mathematical value of sine(pi) (i.e. 0). As mentioned above, the IEEE mantissa gives you almost 16 decimal digits of precision, so anything in the same order around 0 is OK.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to