Just tried googling but couldn't find any example, but how 3 % 5 = 3
|
|
If $a$ and $b$ are positive integers, there exist unique integers $q$, $r$ with $$a = bq + r$$ and $0 \leq r < b$. This theorem is called the division algorithm, and $a\ \%\ b$ is defined to be this $r$. In your case, $3 = 0\cdot5 + 3$ and $0 \leq 3 < 5$, so the answer is 3. |
||||
|
|
|
$a \equiv b \, (\text{mod} c)$ means $a-b$ is divisible by $c$. [Definition] Since $3 - 3 = 0$ is divisible by $5$, we have $3 \equiv 3 \, (\text{mod} 5)$. |
|||
|
|
|
hmmm Actually Mod (%) returns the remainder Given two positive numbers, a (the dividend) and b (the divisor), a modulus % is the remainder of the Euclidean division of a by b. For instance, the expression "9 mod 8" would evaluate to 1 because 9divided by 8 leaves a remainder of 1, while "9 mod 3" would evaluate to 0 because the division of 9 by 3 leaves a remainder of 0. hope this will help you cheers |
|||
