Contribute Media
A thank you to everyone who makes this possible: Read More

(Not-so) Precise Float Arithmetic in Python

Description

Just like in other programming languages, floating number arithmetics is not very precise in Python. What makes floats so special and weird that a simple arithmetic operation might not yield the expected result? Why is it so? For instance, what happens when you run the following line on the Python terminal: 0.1+0.1+0.1==0.3? What will be the output? True or False?

This small talk will focus on the underlying behavior of floating arithmetics precision and then discuss a few potential solutions to the problem in Python.

Details

Improve this page