# 数学-快速幂
- 参考:
## 0、定义
## 1、操作
## 2、Go实现
```go
import "fmt"
func main() {
fmt.Println(mypow(2, 200))
}
var mod = 1000000007
func mypow(a int, n int) int {
res := 1
for n > 0 {
if n%2 == 1 {
res = res * a % mod
}
a = a * a % mod
n = n / 2
}
return res
}
```
## 3