The mod operator gives different results if a dividend or divisor is negative, that depend on the division function I think, as it can be truncate division or a floored division.
Instead, if we use the Euclidean division the quotient and the remainder are unique.
The results are correct but why there is this ambiguity? Is it related to performance and efficiency?