Can the same mathematical operation return different results in different architectures or browsers ?
Can the same mathematical operation return different results in different architectures or browsers ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Although the ECMAScript language specification 5.1 edition states that numbers are primitive values corresponding to IEEE 754 floats, which implies calculations should be consistent:
http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf
As BlueRaja points out, there is a sort of caveat in section 15.8.2:
Meaning, these are at least some cases where the outcome of operations on numbers is implementation dependent and may therefore be inconsistent.