go-examples

Get Set Learn Go


Project maintained by sagar-jadhav Hosted on GitHub Pages — Theme by mattgraham

Math Functions

Example demonstrates following Math Functions available in Go:

func main() {
	fmt.Println("2^4 =", pow(2, 4))
}

func pow(base, exp float64) float64 {
	return math.Pow(base, exp)
}

Output

2^4 = 16
Try It Out Source Code

Contributors

« Home Page Previous « Comparison Operators Next » Format Verbs