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/044128.html below:

[Python-Dev] Expert floats

[Python-Dev] Expert floats [Python-Dev] Expert floatsAndrew Koenig ark-mlist at att.net
Tue Apr 6 11:09:37 EDT 2004
> I believe Ping would have
> 
> >>> 2.20 - 1.20
> 1.0000000000000002

As would I.

> because "1.0000000000000002" is the shortest string that evals to the true
> machine result.  OTOH, he'd have
> 
> >> 2.20 - 1.10
> 1.1

Believe it or not, this apparent anomaly doesn't bother me, but

>>> 1.1
1.1000000000000001

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



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