Re: Power with modulu

2004-12-05 Thread Bengt Richter
On Sun, 05 Dec 2004 12:59:40 +0200, Roie Kerstein <[EMAIL PROTECTED]> wrote: >Hello! > >I want to compute a**b%c for very long numbers. >Computing a**b and then applying modulu is not practical, since it takes >ages. >There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), >and i

Re: Power with modulu

2004-12-05 Thread Mitja
On Sun, 05 Dec 2004 12:59:40 +0200, Roie Kerstein <[EMAIL PROTECTED]> wrote: Hello! I want to compute a**b%c for very long numbers. Computing a**b and then applying modulu is not practical, since it takes ages. There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), and it work

Re: Power with modulu

2004-12-05 Thread Fredrik Lundh
Roie Kerstein wrote: > I want to compute a**b%c for very long numbers. > Computing a**b and then applying modulu is not practical, since it takes > ages. > There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), > and it works well. > My question is: How can I write it is a form