DEV Community

Mayemene Fomene Jean Vladimir
Mayemene Fomene Jean Vladimir

Posted on

Floating Point Imprecision

What is Floating point imprecision?

These two expressions in python are suppose to produce the same result. But why don't they do that?

>>> 7 / 3 * 3
7.0

>>> 1 / 3 * 7 * 3
6.999999999999999
Enter fullscreen mode Exit fullscreen mode

When should you be careful about floating point imprecision?

Oldest comments (0)