Maple to Mupad Conversion, huge powers.
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
A university project I've been given has been programmed back when Matlab used Maple, meaning having to use very out of date matlab versions. The maple code is as follows,
maple('check1:=gcd((g&^lambda mod nsquare-1)/n,n)');
The following is the code I'm trying to use to update this to Mupad,
gLam = feval(symengine,'_mod',g^lambda,nsquare-1)/n;
With the gcd being handled later, the main issue is that the values of g are in the region of 137391914088787611368 and the values of lambda around 7427535290. With Maple these seem to be handled fine even though its a gigantic number, is this totally unmanageable by Mupad or is there a trick that I could use.
The current error is the following,
Error using mupadmex
Error in MuPAD command: Integer too large in
context. [_power]
Evaluating: symobj::mpower
Error in sym/privBinaryOp (line 1694)
Csym = mupadmex(op,args{1}.s,
args{2}.s, varargin{:});
Error in sym/mpower (line 194)
B = privBinaryOp(A, p, 'symobj::mpower');
Error in randomg2 (line 6)
gLam =
feval(symengine,'_mod',g^lambda,nsquare-1)/n;
Error in keygen2 (line 32)
[g]=randomg2(lambda,n,nsquare);
Thanks
David
2 commentaires
Walter Roberson
le 13 Nov 2012
In Maple, &^ is an "inert" operator, signifying that an exponential operation exists there but is not to be calculated immediately. Maple's mod operator knows how to deal with such operations, and there are techniques for calculating the mod of an exponential that do not always require that the full value be calculated.
I do not know if MuPAD has an equivalent.
Réponse acceptée
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!