This website requires JavaScript.
Explore
Help
Sign In
mirror
/
RosettaCodeData
mirror of
https://github.com/acmeism/RosettaCodeData.git
Watch
1
Star
0
Fork
You've already forked RosettaCodeData
0
Code
Issues
Packages
Projects
Releases
Wiki
Activity
master
RosettaCodeData
/
Task
/
Modular-exponentiation
/
Sidef
/
modular-exponentiation-2.sidef
9 lines
132 B
Plaintext
Raw
Permalink
Blame
History
func expmod(a, b, n) {
var c = 1
do {
(c *= a) %= n if b.is_odd
(a *= a) %= n
} while (b //= 2)
c
}
Reference in New Issue
View Git Blame
Copy Permalink