replace zxq.co/ripple/hanayo
This commit is contained in:
15
vendor/github.com/felipeweb/gopher-utils/math.go
generated
vendored
Normal file
15
vendor/github.com/felipeweb/gopher-utils/math.go
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package gopher_utils
|
||||
|
||||
// PowInt is int type of math.Pow function.
|
||||
func PowInt(x int, y int) int {
|
||||
if y <= 0 {
|
||||
return 1
|
||||
} else {
|
||||
if y%2 == 0 {
|
||||
sqrt := PowInt(x, y/2)
|
||||
return sqrt * sqrt
|
||||
} else {
|
||||
return PowInt(x, y-1) * x
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user