4 % 3 == 1
-4 % 3 == -1
4 % -3 == 1
-4 % -3 == -1
Changing the sign of the first number changes the sign of the result. The sign of the second number doesn't matter.
This is true in many languages (C, C++, Java, Javascript) but not all languages (Python, Ruby).