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) complex128Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | complex128 | First input operand (or sole input if unary). |
| y | complex128 | Second 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)}