a mod b, when b is greater than a

$\begingroup$

Why

6 % 10 = 6

As fa as I know 10 % 6 = 4, but I don't know how to handle the first one

Thanks!

$\endgroup$ 4

2 Answers

$\begingroup$

The modulo operator a mod b gives the remainder when you divide a by b. Can you then work out the remainder when 6 is divided by 10?

$\endgroup$ 2 $\begingroup$

Division Theorem:

For any integer $M$ and any natural $n$ then if you divide $N$ by $n$ you will get a unique integer quotient $q$ and unique remainder integer $r$, between $0$ (inclusive) but less than $n$ so that $M= qn + r$.

$r$ is the remainder and $0 \le r < n$ and $q$ is the quotient and $q \le \frac Mn < q+1$.

And $M\% n = r$. That is the definition.

SO if $M = 6$ and $n = 10$ what are $q$ and $r$ so that that:

$6 = q*10 +r$ and $q \le \frac{6}{1} < q+1$?

THe answers are:

$q=0$ and $r =6$.

$6 = 0*10 + 6$.

And so $6\% 10 =6$

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like