How to calculate modulus in programming
- how is modulus calculated
- how is mod calculated
- how is youngs modulus calculated
- how is experience mod calculated
Power mod calculator...
How to calculate modulus without calculator
Modulo Operation
The modulo (or "modulus" or "mod") is the remainder after dividing one number by another.
Example: 100 mod 9 equals 1
Because 1009 = 11 with a remainder of 1
12 Hour Time
12-hour time uses modulo 12
Example: 14 mod 12 equals 2
Because 1412 = 1 with a remainder of 2
So 14 o'clock becomes 2 o'clock.
We are only interested in where we end up, not how many times around.
Play with it here:
images/mod-anim.js
Notation
We normally write "mod": 14 mod 12 = 2
Some programming languages use the percent sign: 14 % 12 = 2, but % is just a convenient symbol and has nothing to do with percents.
Modulus and Addition
You can also play with adding numbers using different modulo values here:
images/mod-circle-add.js
Modulus with Multiplication
You can also have a play with this.
It multiplies each number by your chosen value, then links to the modulus of that multiplication. It makes some really interesting patterns:
images/mod-circle-mult.js
25355, 25356, 25357, 25358, 25359, 25360, 25361, 25362, 25363, 25364
Digital R
- how is mod rate calculated
- how is modulus of elasticity calculated