Standard library / math/cmplx

cmplx.Exp()

Complex exponential. Expected stdout: '1 0\n'.

Formal Syntax & Structure

go syntaxgo
func Exp(x complex128) complex128

Parameters & Attributes

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

Return Value

complex128

Complex exponential.

Working Example

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