2

I have obscurity. Why if I multiply

8.2 * 1000000 = 8199999.999999999

But if i mul to

8.2 * 1000 = 8200

Maybe advice me topic about this issue.

Codor
  • 17,447
  • 9
  • 29
  • 56
Vlad Honya
  • 160
  • 3
  • 13

1 Answers1

1

The floating point representation of JavaScript has a limited accuracy; its resolution decreases as the absolute value of the data grows (which is the case for all implementations of floating point data types). This is also discussed here.

Codor
  • 17,447
  • 9
  • 29
  • 56