[Python-Dev] Expert floats (original) (raw)
Jewett, Jim J jim.jewett at eds.com
Tue Apr 6 10:29:10 EDT 2004
- Previous message: [Python-Dev] PEP 327: Decimal data type
- Next message: [Python-Dev] Expert floats
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] PEP 327: Decimal data type
- Next message: [Python-Dev] Expert floats
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]