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

When should you be careful about floating point imprecision?

Did you find this post useful? Show some love!
DISCUSSION
Classic DEV Post from Apr 20

How do you avoid feelings of entitlement?

At a certain level of achievement in a software, it can be easy to become entit...

Mayemene Fomene Jean Vladimir
Join dev.to

The fastest growing software community.
Free forever.