Modulo function f (a, p,q) = (ap mod q)
Write a Java function for thecomputation of modulo operation ap modq. You need to use the following property in Modulararithmetic:
(a × b) mod c = [(a mod c) *(b mod c)] mod c
The above formula can be extended tofollowing result:
ap mod q = (a modq)p mod q
The idea is to use the above formulasto reduce the value ap to avoid the overflowduring the calculation.
In this function the parameters a,p, and q should be declared as long type. The easiestway is to use the recursion for the implementation
PayPal Gateway not configured
PayPal Gateway not configured