Standard library / math

math.Pow()

Raises x to y; negative finite base and noninteger finite exponent produce NaN. Expected stdout: '1024\n'.

Formal Syntax & Structure

go syntaxgo
func Pow(x, y float64) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).
yfloat64Second input operand.

Return Value

float64

Raises x to y; negative finite base and noninteger finite exponent produce NaN.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Pow(2, 10))}
Go Reference