SyntaxFix
Write A Post
Hire A Developer
Questions
Adding some understanding.
By Euclidean definition the mod result must be always positive.
Ex:
int n = 5; int x = -3; int mod(int n, int x) { return ((n%x)+x)%x; }
Output:
-1