1. Negative Division:
>>> Print 45/7
6
>>> PRINT-45/7
-7
>>> Print 45/-7
-7
>>> print-45/-7
6
For the first example: the first number contains the number of the second number 45 contains how many 7 its result is 6
For the second example: what is the distance between the first number and the second number-the distance between 45 and 7 is 52 52/7=7 The result is a sign of-7
Can be understood as-((45+7)/7)
2. Modulo operation
The two operations of modulus and redundancy cannot be confused, and no negative numbers are pressed to calculate the remainder in C/s + + java. It's not the same in Python.
>>> Print 45%7
3
>>> print-45%7
4
>>> Print 45%-7
-4
>>> print-45%-7
-3
We all know the formula for modulus or redundancy: c=a/b;r=a-c*b
The result of the Python modulo is to determine whether the result is positive or negative based on the second number.
C + + Java is determined by the first number of its results
The current environment is python2.7.6 do not know the low version and the high version of what is different have been verified please inform. ......
Python negative division and modulo operation