0

This question is just for curiosity:

I am trying to compute the following calculation in Chrome and Safari console:

console.log(1.03 + 4.4); // 5.430000000000001 as output

I want to know why this difference happens, and why the output isn't just 5.43

If I try with different numbers there is no problem.

I think this is related with how Javascript represents the float points. But this is just a guess.

Any information is welcome

Pierre G.
  • 4,346
  • 1
  • 12
  • 25
Federico
  • 469
  • 2
  • 15

0 Answers0