floating Pt. Division errors in Windows 2000

Leon Webster leon at leonwebster.com
Fri Nov 30 04:36:20 CET 2001


I am just learning Python using the book Learning Python.  Here's a sample
problem from the book:
>>>a = 3
>>>b =4
>>>b/(2.0 + a)

When I execute this on my laptop (win2k machine, pentium III), I get the
following answer:

0.80000000000000004

The same program on Linux provides the right answer (0.8), as does a program
written in Java.

Does anyone know why this happens?  Is this a problem with Python on Windows
or Win 2k?

Thanks much

Leon





More information about the Python-list mailing list