0
Full division on negative numbers
Heya, Can someone explain to me the logic behind : print(-11//3) -4 ??why a full division of -11 by 3 is -4 and not -3? Thanks in advance.
3 Respuestas
+ 6
Floor division works this way - it does not round to zero. Rather, it always returns the *next lower* integer, whether positive or negative.
BTW, that's why it's called *floor* not "integer" or something.
+ 1
-11/3 is -3.6666666 ... // is floor division and floor division rounds down.. It rounded down to -4
+ 1
I see I see, thanks!