Alain SMEJKAL on Tue, 13 Dec 2005 11:07:45 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: modular exponentiation |
----- Original Message ----- From: "Jeroen Demeyer" <J.Demeyer@UGent.be> To: "Henk Karssenberg" <henk.karssenberg@hu.nl> Cc: <pari-users@list.cr.yp.to> Sent: Friday, November 25, 2005 1:54 PM Subject: Re: modular exponentiation > Henk Karssenberg wrote: > > Dear M., > > > > In PARI I try to calculate k = Mod(6682632708227277^28345232917, > > 72057594037927889) but this gives an overflow. Is there any option to > > calculate Mod(a^m,n) or a^m % n with huge numbers ? > > > > Thank you & kind regards. > > Henk, > > You should do k = Mod(a,n)^m. > This works because Mod(a,n) creates an object in Z/nZ. > Dear List, This method is very efficient but, is there a way to avoid spurious warning occuring on large exponents ? (Unsuccessfully tried \g debug preference) ? Mod(10,123456)^10000000000 *** Warning: multiword exponent in Fl_pow. Regards, Alain