Template:Prelude/pow mod.a68: Difference between revisions

m
Template template
(This routine is used in more then one place, and is essentially a template that can by used for many different types, eg INT, LONG INT...)
 
m (Template template)
 
(4 intermediate revisions by 2 users not shown)
Line 1:
COMMENT
This routine is used in more thenthan one place, and is essentially a
template that can by used for many different types, eg INT, LONG INT...
USAGE
MODE POWMODSTRUCT = INT, LONG INT, COMPL, FRAC, MODULAS, MATRIX etc
PR READ "precludeprelude/pow_mod.a68" PR
END COMMENT
 
Line 12:
e:=e OVER 2;
WHILE e /= 0 DO
sq *:= sq * sq %* mod;
IF ODD e THEN out := out * sq %* mod FI ;
e:=e OVER 2
Line 18:
out
)
<noinclude>{{template}}</noinclude>
Anonymous user