why do we use modulus properties while solving questions. we can also do this by calculating power by math function and simply talking modulus.
Why do we use modulo properties
inorder to avoid integer overflow
modulo keeps the value in range
hence using the modulo properties is important
directly caculation a^b could result in a bigger value
a^ (b/2) mod m would reduce the number then again multiplying by a^(b/2) mod m would prevent any such overflow
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.