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 Jun 13

How do you make time for your dev/tech projects?

Question I was about to write a long post about how I'm unable to allow a part...

READ POST
Follow @sudiukil to see more of their posts in your feed.
Mayemene Fomene Jean Vladimir
Member since May 7, 2018
More from @vladimirfomene
Make A Recursive Anonymous Factorial Function In Python.
#lambda #recursion #python
Trending on dev.to
How to create REST API using Pyramid
#rest #api #pyramid #python
Looking for Tech Lead resources (books, sites, etc.)
#help #leadership #technical #softskills
$1m to pay open source maintainers on Tidelift
#opensource #javascript #python #java
What Open-source Load Balancer Have You Used Before or Still Using Now?
#opensource #help #discuss
Teaching my robot with TensorFlow
#python #tensorflow #machinelearning #deeplearning
What is a developer advocate ?
#help
Learning Algorithms with JS, Python and Java 8: Sentence Capitalization
#beginners #javascript #python #java
So you want to become a developer? Part I
#beginners #career #help