A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044139.html below:

[Python-Dev] Expert floats

[Python-Dev] Expert floats [Python-Dev] Expert floatsGreg Ewing greg at cosc.canterbury.ac.nz
Tue Apr 6 21:58:33 EDT 2004
Andrew Koenig <ark-mlist at att.net>:

> The reason is that the first example does arithmetic, and it is easy
> to explain that floating-point arithmetic is not completely accurate.

Then how would you explain this to them:

>>> 1.1 < 1.1000000000000001
False

There's no arithmetic being done there.

And if you're thinking of something like "floats don't have that
many digits of precision", you then need to explain

>>> 1.2 < 1.2000000000000001
True

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4