> How did the class react to floating-point? Seeing behaviour like this: > > >>> 3.3 > 3.2999999999999998 > >>> > > confused and frightened them, and continues to confuse and frighten > almost everyone i teach. ... Every time this happens, the teaching is > derailed and i am forced to go into an explanation of binary > floating-point to assuage their fears. This is an argument for making some form of decimal floating point the default in Python, with binary FP an option for advanced users -- not an argument for trying to hide the fact that binary FP is being used. Because you *can't* hide that fact completely, and as has been pointed out, it *will* rear up and bite these people eventually. It's much better if that happens early, while there is someone on hand who understands the issues and can guide them gently through the shock-and-awe phase. 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 +--------------------------------------+
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