A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Expert floats

[Python-Dev] Expert floats [Python-Dev] Expert floatsJewett, Jim J jim.jewett at eds.com
Tue Apr 6 10:29:10 EDT 2004
Ka-Ping Yee:

>    >>> 3.3
>    3.2999999999999998

> confused and frightened them, and continues to confuse and frighten
> almost everyone i teach. 

It bothered me when I first saw it (not in Python).

It was still better than trying to figure out why my code was doing
the wrong thing, when my math and logic were both clearly correct.  

To steal Simon Percivall's example, I assumed 2.20 - 1.20 == 1.00.
It didn't even occur to me to check something as obviously true as 
that -- until I had learned and remembered that floats were not 
decimals.

-jJ

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