[Turn] Mathematical Programming and - a remainder, the modulo operation and their properties

statement

Transfer: https://blog.csdn.net/chensilly8888/article/details/42834697
this blog has a brief lean describes the differences between remainder and modulo arithmetic in mathematics and computer science, meanings in different languages modulo and the nature of the modulo operation
because I think oi programming, only need to understand the nature of modulo on the line, because when the programming contest, write-only one language, the code will play their usual familiar with that language the syntax and the like.

Properties of the modulo operation

If a≡b (mod m), x≡y (mod m), then a + x≡b + y (mod m).

If a≡b (mod m), x≡y ( mod m), the ax≡by (mod m).
// When x == y, the first two conditions are in line with the nature of it, you can use it.

If ac≡bc (mod m), and c and m are relatively prime, then a≡b (mod m) (that is the same on both sides of the formula I can be divided simultaneously a and modulo prime number )

Guess you like

Origin www.cnblogs.com/tyner/p/11790184.html