Modular exponentiation should not be modular in the second argument
Closed this issue · 0 comments
sladecek commented
(Mod(2,2)**2, 2**2 %2)
gives ((1 % 2), 0)
Also, when the exponent is negative, modular inversion should be used so that (x**e) * (x**(-e)) == 1