Modular Exponentiation (Power in Modular Arithmetic) - GeeksforGeeks
Modular Exponentiation (Power in Modular Arithmetic)
Given three numbers x, y and p, compute (xy) % p.
Examples
Input: x = 2, y = 3, p = 5 Output: 3 Explanation: 2^3 % 5 = 8 % 5 = 3. Input: x = 2, y = 5, p = 13 Output: 6 Explanation: 2^5 % 13 = 32 % 13 = 6.
We strongly recommend you to minimize your browser and try this yourself first.
Read full article from Modular Exponentiation (Power in Modular Arithmetic) - GeeksforGeeks
No comments:
Post a Comment