Nepedia
Back to Discover
Independent Reader
🔢

Modulo

math Maturity 7-9 Next article →

Imagine you are dividing things into equal groups. Sometimes, a few items are left over. In math, we call this leftover part the remainder. The modulo is a special way to find that remainder.

Divmod truncated
Divmod truncated

For example, if you have five items and divide them by two, you get a remainder of one. We can write this as "5 mod 2 = 1". If you have nine items and divide them by three, the remainder is zero.

Divmod Euclidean
Divmod Euclidean

Computers use modulo a lot. They use it to solve puzzles and keep data safe. Many computer languages use symbols like "%" or the word "mod" for this.

Divmod floored
Divmod floored

Different computers may handle negative numbers in different ways. Some keep the remainder positive. Others let the remainder be negative. This can lead to mistakes if a coder is not careful. One way to check if a number is odd is to see if the remainder is not zero.

Divmod rounding
Divmod rounding

This is because a remainder of zero always means the number is even. Modulo is a very useful tool in the world of math and coding.

177 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (5)
File:Divmod truncated.svg
Divmod truncated.svg
File:Divmod floored.svg
Divmod floored.svg
File:Divmod Euclidean.svg
Divmod Euclidean.svg
File:Divmod rounding.svg
Divmod rounding.svg
File:Divmod ceiling.svg
Divmod ceiling.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.