code not true?
moshez at math.huji.ac.il
Sat Apr 22 08:25:38 EDT 2000
On Sat, 22 Apr 2000 jeff_islay at my-deja.com wrote:
> Why does the second example return false?
> >>> print 7.0 == 7
> >>> print (.07 * 100) == 7
Because computers represent floats with too little bits.
Never ever compare two floats for equality!
Moshe Zadka <mzadka at geocities.com>.
http://www.linux.org.il -- we put the penguin in .com
More information about the Python-list