A silly question...

Revision en1, by roll_no_1, 2018-06-22 08:28:04

This question might sound a little silly, but I was not able to figure the solution to this.

Say, I want to compute an expression of the form (a * b) / c, and I want to do it modulo 13. Now, if a = 13, b = 3, c = 13, then the answer clearly is 3. But if I try to do it this way (((a % 13) * (b % 13)) * inv(c % 13)) % 13, where inv(x) return the multiplicative inverse of x modulo 13, it will not work out. So, how to work around this one ?

Tags maths, modular arithmetic, calculation, modular inverse

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English roll_no_1 2018-06-22 19:58:35 526 Tiny change: 'this one ?' -> 'this one ?\n\n[Edit][user:Megumi_Tadokoro] '
en1 English roll_no_1 2018-06-22 08:28:04 462 Initial revision (published)