simple math don't work like I expected

Elvis Zaichenok elvis at e-apollo.lv
Wed Jan 29 10:39:28 EST 2003


Please, could somebody explain why things work like this? Why 1.0<1?


Python 2.2 (#1, Apr 12 2002, 15:29:57)
[GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-109)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=1.99
>>> while a<2.01:
...     if (a-1)<1:
...         print(str(a-1)+'<1')
...     a=a+0.005
...
0.99<1
0.995<1
1.0<1


Thanks.




More information about the Python-list mailing list