1

Can someone explain the logic behind why the chrome and firefox engines do below arithmetic differently than IE? Below is a snap from firefox console.

Screenshot from browser console

console.log('(26.6811*1000/1000) = ' + (26.6811 * 1000 / 1000));
console.log('(26.6821*1000/1000) = ' + (6.6821 * 1000 / 1000));
console.log('(26.6721*1000/1000) = ' + (26.6721 * 1000 / 1000));
  • 2
    Possible duplicate of [How to deal with floating point number precision in JavaScript?](https://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-javascript) – rmlan Feb 02 '18 at 14:51
  • @rmlan The behavior is different in IE compared to Chrome and Mozilla – user1455410 Feb 02 '18 at 15:05

0 Answers0