[Tutor] list of floats, strange behavior

tpc at csua.berkeley.edu tpc at csua.berkeley.edu
Wed Sep 1 08:35:02 CEST 2004


hi everybody, I was wondering if someone could help me understand why IDLE
seems to expand the largest value in a series of floating points I decided
to put in a list:

>>> list01 = [.1028, .1248, .0998, .1101, .1062]
>>> list01.sort()
>>> list01
[0.0998, 0.1028, 0.1062, 0.1101, 0.12479999999999999]

I don't particularly want that value expanded like that.



More information about the Tutor mailing list