Floating Point Imprecision

vladimirfomene

Mayemene Fomene Jean Vladimir

Posted on June 13, 2018

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?

💖 💪 🙅 🚩
vladimirfomene
Mayemene Fomene Jean Vladimir

Posted on June 13, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Floating Point Imprecision
python Floating Point Imprecision

June 13, 2018