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
(Why it floors)
The modulo operation on the other hand is following the mathematical definition.
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
(Why it floors)
The modulo operation on the other hand is following the mathematical definition.