MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / b_expo_mod

Function b_expo_mod

other/binary_exponentiation_2.py:26–35  ·  view source on GitHub ↗
(a, b, c)

Source from the content-addressed store, hash-verified

24
25
26def b_expo_mod(a, b, c):
27 res = 0
28 while b > 0:
29 if b&1:
30 res = ((res%c) + (a%c)) % c
31
32 a += a
33 b >>= 1
34
35 return res
36
37
38"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected