Previous Up Next

5.36.10  Compute an mod p: powmod powermod

powmod (or powermod) takes as argument a,n,p.
powmod (or powermod) returns an mod p in [0;p−1].
Input:

powmod(5,2,13)

Output:

12

Input:

powmod(5,2,12)

Output:

1

Previous Up Next