Find modulus:
First, the question is, what is the modulus?
Modulus |
5/2 = 2 and 1 is remainder. Modulus is defined by mod.
We can find this remainder easily in c programming. We also can find quotients easily both calculator and using c programming. But sometimes there needs to be a mod button in our scientific calculator. So, the question is, how to find a modulus by a simple calculation.
Suppose we have x mod y, that's means we have to find the modulus or remainder.
Here the rule is:
Dividend / Divisor = Quotient
Quotient * Divisor = X
Dividend - X = Modulus
For example:
X mod Y. We want to find out the value of mod.
Here X = 343 and Y = 23
Now we divide X by Y
The value is X / Y = 14.913
We take the non-fraction value, that means only 14 (Integer part of the result).
Then we have to do 14 * 23
The multiply value is 14 * 23 = 322
Now we have to subtract this value from 343(X)
Means 343 - 322 = 21
Now 21 is the modulus value.
Let look another small example:
Here 2 will go 12 times in 25. So, Divisor 2 * Quotient 14 = 24 and then Dividend 25 - 24 = 1 Modulus.
In simple words, Modulus = Dividend - Divisor * Quotient.
Calculating modulus by simple calculation is now understandable.
Post a Comment