I am trying to convince myself without using the calculator to compute the negative numbers that are moded by a positive number, i.e. ($-x \mod y$). I found out that if ($x<y$), then it is easy just by taking the difference between x and y: Example: $-10 \mod 17 = 17-10 = 7$.
However, I get stuck when $x>y$, For example, $-18 \mod 17 = 16$ so I really do not know how 16 comes up. Can someone explain how 16 is the answer? Or can you generalized the case ($x<y$)?
Thank you very much