Multiplication and modulo - Order of operations

141 Views Asked by At

Simple question

I have $$a\cdot b\cdot c\;mod\;p$$

How do I interpret this? Do i read it as this $$(abc)\;mod\;p$$ or is it $$a\cdot b\cdot (c\;mod\;p)$$

Or do I completely misunderstand modular arithmetic?

Thanks!

2

There are 2 best solutions below

1
On BEST ANSWER

Yes, it's $(a b c) \mod p$. In fact $$ x \mod p =(x)\mod p \text{ for any expression } x $$

0
On

You can see this as $a*b*c(mod p)$ or $a(mod\ p) *b(mod\ p)* c(mod\ p)$.