How to Raise a Number to a Power in Golang

If you need to raise a number to a power in Golang, then you can use the math.Pow function:

package main import ( "math" ) func main() { var exponent, base float64 output := math.Pow(base, exponent) }
Code language: Go (go)

Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments