Print(1 % 3) = 1 why?

How come print(1 % 3) is one?
Is it because of how the system finds the remainder?

If we divide 1 by 3 we get 0, with remainder 1.

3 ) 1  |  0   # quotient
  - 0         # minus 0 * 3
    1         # Remainder

! Thank you… I guess I was confused with the concept of remainder for a minute

1 Like

You’re welcome. Rest assured you are not alone. I’m not sure if long division is even taught any more. It’s an old pencil and paper technique that we learned around grade three ~fifty years ago or more. Mind, there were no calculators back in the day so we had to learn how to compute division manually.

d * q == D - R

divisor times quotient equal to Dividend minus Remainder

Above, d and q , and D and R are integers.

Re: Learning division with remainders…
… and promptly forgot once fractions were introduced!

Ah, yes… Simplify, simplify…

Saddest thing is, though, back in the day they never told us the remainder was the modulo of the division. It took getting into High School Math to learn what that was. Sheesh; and further to the disappointment they waited until Grade 12 to introduce the Calculus. That stuff should be introduced in Grade 7 and 8 when Exponent Laws are introduced.

Also sadly, synthetic division and factoring are introduced later than needs be. It could be introduced in Grade 9. Along side could be the Remainder Theorem to take into Grade 10.

A tiny paradigm shift would produce wiser students down the home stretch, namely, high school maths and sciences. Opining, like usual, mind.

That formula is one step away from euclid’s divison lemma
a = bq + r where 0 ≤ r ≤ b .

All of this “simple” math is Discrete math. It’s really cool how complex counting can become

1 Like