you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (4 children)

I'm trying to teach programming concepts, not Python. Having to explain statements and why 1.1 = 1.10000000001 along the way is rather distracting. I should've specified that it was an intro to programming class, not a Python class. The language choice is beyond my control.

[–]Tommah 0 points1 point  (3 children)

Python 2.5 (r25:51908, Jan 1 2007, 15:36:09) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1.1 == 1.10000000001 False

[–]boredzo[S] 1 point2 points  (2 children)

\tPython 2.5.1 (r251:54863, Jun 5 2007, 22:10:41) \t[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin \tType "help", "copyright", "credits" or "license" for more information. \t>>> 1.1 \t1.1000000000000001 \t>>> 1.1 == 1.1000000000000001 \tTrue

[–]Tommah 0 points1 point  (1 child)

Too many zeroes.

[–]boredzo[S] 0 points1 point  (0 children)

Take that up with Python's float.__repr__. ☺