Integer math question

Frank mersmann at szut.uni-bremen.de
Sat Jan 3 11:32:07 EST 2004


Hi,

can anybody help with the following problem?

In C++

i = 5 / 10 	and
i = -5 / 10 	both have the same result 0.

In python

i = 5 / 10 	gives me 0 as expected, but
i = -5 / 10 	gives -1 as result.

Is this a feature or a bug? I remember Delphi gave me the same result as
C++.

TIA,
Frank



More information about the Python-list mailing list