What is the difference between true division and floor division for negative numbers?
Numbers and arithmetic
Audio flashcard · 0:15Nortren·
What is the difference between true division and floor division for negative numbers?
0:15
Floor division rounds toward negative infinity, not toward zero. So negative seven divided by two using floor division equals negative four, not negative three. This is consistent with Python's modulo operation, which always returns a result with the same sign as the divisor.
---
docs.python.org