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)  
}