In Python, the principle behind integer division, which is denoted by two forward slashes //
, is to divide one integer by another, and rather than giving the exact answer, it rounds down the answer to an integer. I can understand that part.
print(8//5)
# output : 1
But why does the output differ when the first number is negative?
print(-8//5)
# output : -2