0

Doesn't $ac\bmod m = (a\bmod m*c\bmod m)\bmod m$ and $ac\bmod m = (a\bmod m*c)\bmod m$ return the same result which are both correct

The only difference I see is $(c\bmod m)$ reduces the multiplication with $(a\bmod m)$ in the first formula. Is there any difference in the outputs for the two functions for any particular case?

  • 1
    Formatting note: you need to put a pace between the \bmod and the modulus. That is, "\bmod m" works but "\bmodm" doesn't. Also: the direction of the slash matters. – lulu Sep 05 '24 at 16:39
  • Thank you for the help, I hope the question is better understood now. – Sanjayraj M Sep 05 '24 at 16:43
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 05 '24 at 16:43
  • Yes they are equal - see the Key Idea in the linked dupe. – Bill Dubuque Sep 05 '24 at 17:27

0 Answers0