modular arithmetic Q

Sonal7

Full Member
Joined
Oct 4, 2019
Messages
485
I understand the topic in general:

x mod y = r, x is the dividend, y is the divisor and r is the remainder.

but I don't understand how 2 mod 5 = 2, does this come from 5*0 +2 = 2?

i just wanted to check.
 
Yes, that's right. The quotient is 0 and the remainder is 2.

One way to think of it is that the quotient is the greatest integer in x/y, q = floor(x/y), and the remainder is then x - qy. Here, floor(2/5) = 0.

Another is that the remainder x mod y is the smallest non-negative integer r such that x = qy + r for an integer q.
 
Well explained, thank you so much. When you publish a maths textbook please put this on the forum so that we can buy a copy!
 
I understand the topic in general:
x mod y = r, x is the dividend, y is the divisor and r is the remainder.
but I don't understand how 2 mod 5 = 2, does this come from 5*0 +2 = 2?
Have a look at this table.
Note that the output is a number 0n4\displaystyle 0\le n\le 4
But in particular, note the output for the negative numbers. Make sure that you understand those answers,
 
Very informative, clear presentation of the the cyclic pattern. Thank you.
 
Top