Bitten by my C/Java experience

Chris Angelico rosuav at gmail.com
Mon May 4 13:40:50 EDT 2015


On Tue, May 5, 2015 at 3:32 AM, Irmen de Jong <irmen.NOSPAM at xs4all.nl> wrote:
> That is a broad question, but one thing that comes to mind is the current (python 3)
> behavior of integer division. It gives the exact result and doesn't truncate to integers:
>
>
>>>> 5/4
> 1.25

Using the word "exact" around non-integer values can be a little
ambiguous, since floats are often inexact. But yes, int/int -> float,
and yes, it WILL bite C programmers.

ChrisA



More information about the Python-list mailing list