Q:

different result from 1 // -2 and int(1 / -2) in python3

i'm seeing a different result from 2 different division method for the same formula. 
1 // -2 will give -1
however
int(1 / -2) will give 0
I've been searching python division question but didn't see anything related to a division between a position number and negative number. any thoughts on this one?

A:

They don't do the same thing. // floors the result, while int rounds toward 0. The difference is subtle but important.
In [251]: 1 / -2
Out[251]: -0.5

In [252]: 1 // -2
Out[252]: -1

Versus, 
In [253]: int(1 / -2)
Out[253]: 0

The difference is more apparent with negative numbers, where int would round up (because it rounds to 0) whereas // (floor division) rounds down regardless.

