Why does -10 // 3 give -4?

Why -10 // 3 gives -4 I thought the // operator just acts as a delimiter, but discards the rest. I am using python 3.4.2 IDLE

This also seems to be happening for the% operator, i.e. -10% 3 gives 2

+4
source share
1 answer

Python always rounds to negative infinite for operations with integer division and remainder.

Why Python was designed this way is explained by the creator of Python here .

+3
source

All Articles