Asked by Francesca
How do I solve for negative modular arithmetic?
Here is an example: -45 mod 13 = 7, but how?
Here is an example: -45 mod 13 = 7, but how?
Answers
Answered by
Steve
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.
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.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.