Posted by Francesca on Monday, October 10, 2011 at 12:31pm.
How do I solve for negative modular arithmetic?
Here is an example: 45 mod 13 = 7, but how?

Math  Steve, Monday, October 10, 2011 at 12:41pm
a mod b = (a + nb) mod b
so, 45 mod 13 = mod (45 + 52) mod 13 = 7 mod 13 = 7
Just add a big enough multiple of the modulus so you have a positive number.