division bug?

Grant Edwards grante at visi.com
Wed Jun 9 11:04:31 EDT 2004


On 2004-06-09, Milan <milanmor at yahoo.com> wrote:
> a program:
>
> a=10
> b=5
> print a/b
>
> and its result: 0. If you run the program, you see always a zero (0),

What answer do you want?

> but 10/5 is 2. Who can help me?

Perhaps you can. :)

>>> 5/10
0
>>> 5.0/10.0
0.5
>>> 5//10
0
>>> 5.0//10.0
0.0

-- 
Grant Edwards                   grante             Yow!  Hold the MAYO & pass
                                  at               the COSMIC AWARENESS...
                               visi.com            



More information about the Python-list mailing list