The RIGHT Way To Compare Floats in Python
David Amos David Amos
2.5K subscribers
22,355 views
0

 Published On Mar 25, 2022

If you're comparing floating-point values for equality, then you're doing it all wrong! I'll show you the RIGHT way to compare floats in Python.

🔥 Learn more about floating-point numbers ➡️ https://davidamos.dev/the-right-way-t...

⏱️⏱️VIDEO CHAPTERS⏱️⏱️
0:00 - Float Comparison Failures
0:23 - What You'll Learn
0:43 - What Are Floating-Point Numbers?
3:18 - What Numbers Get Rounded When Stored as Floats?
5:42 - How To Compare Floats in Python
🔔 Subscribe for more tips just like this: https://youtube.com/davidamos?sub_con...


👨🏼‍🎓 WANT HELP LEARNING PYTHON?
I offer private one-on-one Python coaching. Learn more ⇢ https://davidamos.dev/coaching/


ABOUT ME
Hi! I'm David Amos, a Python educator and author of Python Basics: A Practical Introduction to Python 3. I've worked as a professional programmer for over 8 years and have spent the last 3 years helping thousands of people learn Python and become better Python programmers. I'm also an avid Julia programmer and co-host of the @Talk Julia podcast.

My book ⇢ https://www.amazon.com/Python-Basics-...
My website ⇢ https://davidamos.dev

#Python #PythonFloats #PythonMath #NumbersInPython

show more

Share/Embed