The integer division there is just taking the floor of the number obtained at the end.
10/3 -> floor(3.33) -> 3
-10/3 -> floor(-3.33) -> -4
The modulo operation on the other hand is following the mathematical definition.
More Related Contents:
- The modulo operation on negative numbers in Python
- Find the division remainder of a number
- How does the modulo (%) operator work on negative numbers in Python?
- In Python, what is a good way to round towards zero in integer division?
- How do I get 4 instead of 4.0 in "Squirrels and nuts – 1" task? [closed]
- What is the result of % in Python?
- How do you check whether a number is divisible by another number?
- Negative integer division surprising result
- What does the percentage sign mean in Python
- Python modulo on floats
- C and Python – different behaviour of the modulo (%) operation
- TypeError: unsupported operand type(s) for /: ‘str’ and ‘str’
- How to replace negative numbers in Pandas Data Frame by zero
- Modulo operator in Python
- Floor division with negative number
- Is & faster than % when checking for odd numbers?
- Sum function prob TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’
- How does Python implement the modulo operation?
- How to know if an object has an attribute in Python
- Overriding special methods on an instance
- Maximum value for long integer
- “pythonic” method to parse a string of comma-separated integers into a list of integers?
- How can I get around declaring an unused variable in a for loop?
- formatting long numbers as strings in python
- Datetime Timezone conversion using pytz
- How to get MD5 sum of a string using python?
- Split string on commas but ignore commas within double-quotes?
- Display image stored as binary blob in template
- Can a variable be used in Python to define decimal places
- color of a 3D surface plot in python