1== 1 is False?

Gerhard Häring gh at ghaering.de
Fri Jun 20 16:21:47 CEST 2003


delphiro wrote:
> [...] If I print out the values I get something like 2.260212 <= 2.260212 and 2.260212 >= 2.260212 is NOT true.
> 
> What's wrong?

Your float values might not be what they look like.

It makes a difference wether you use str() or repr() to convert them to 
strings, for example:

#v+
 >>> 2/3.0
0.66666666666666663
 >>> print 2/3.0
0.666666666667
#v-

-- Gerhard





More information about the Python-list mailing list