On Wed, Mar 16, 2011 at 10:44 PM, Santanu Sarkar
<sarkar.sa...@gmail.com> wrote:
> How one can calculate a^b mod c in Sage for large b?
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>
def __pow__(self, n, modulus):
if modulus is not None:
from sage.rings.finite_rings.integer_mod import Mod
return Mod(self, modulus) ** n
so that should be exactly the same thing.