Standard library / math/cmplx

cmplx.Pow()

Complex exponentiation using principal value conventions. Expected stdout: '8 0\n'.

Formal Syntax & Structure

go syntaxgo
func Pow(x, y complex128) complex128

Parameters & Attributes

NameTypeDescription
xcomplex128First input operand (or sole input if unary).
ycomplex128Second input operand.

Return Value

complex128

Complex exponentiation using principal value conventions.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/cmplx")
func main() {  z := cmplx.Pow(2, 3)  fmt.Printf("%.6g %.6g\n", real(z)+0.0, imag(z)+0.0)}
Go Reference