(base, power)
| 4 | |
| 5 | |
| 6 | def fast_exp(base, power): |
| 7 | result = 1 |
| 8 | while power > 0: |
| 9 | if power % 2 == 1: |
| 10 | result = (result * base) % m |
| 11 | power = power // 2 |
| 12 | base = (base * base) % m |
| 13 | return result |
| 14 | |
| 15 | |
| 16 | # n**0.5 complexity |
nothing calls this directly
no outgoing calls
no test coverage detected