Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Define exprem(b,p,m)=
- Func
- :Local res
- :res:=1
- :While p>0
- : If (p and 1)=1:res:=mod(res*b,m)
- : b:=mod(b*b,m)
- : p:=intDiv(p,2)
- :EndWhile
- :Return res
- :EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement