September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,5 @@
|
|||
_powm(b, e, m, r) = (e == 0 ? r : (e % 2 == 1 ? _powm(b * b % m, e / 2, m, r * b % m) : _powm(b * b % m, e / 2, m, r)))
|
||||
powm(b, e, m) = _powm(b, e, m, 1)
|
||||
# Usage
|
||||
print powm(2, 3453, 131)
|
||||
# Where b is the base, e is the exponent, m is the modulus, i.e.: b^e mod m
|
||||
Loading…
Add table
Add a link
Reference in a new issue