0

test there in their consoles browser

1067.11-1000 = 67.1099999999999

but the correct thing 67.11

can even test the calculator windows ..

could someone explain this to me?

2 Answers2

1

Floating point numbers are stored using base2, this creates small differences like the one you demonstrate above when converting to base10. The difference will be even greater if use the following numbers: 1000000067.11 - 1000000000 = 67.1100000143. This is because the level of precision decreases as the numbers calculated increases.

0

Lack of precision is the main disadvantage of the float type numbers - some real numbers can only be represented approximately.

You can follow this link to learn more about representation of floating point format

Stichoza
  • 4,491
  • 2
  • 23
  • 24