Alex Rivera | Logout

Negative integer division surprising result

Asked 2011-04-04T06:25:04.603
69

In my application I encountered the following and was surprised by the results:

8/-7=-2 (both integers).

What does this mean?

Edit
Report

1 Answer

3

When both values are integers when dividing Python uses Floor division.

answered 2011-04-04T06:29:49.220

Your Answer