Standard library / math/cmplx

cmplx.Conj()

Complex conjugate: negates imaginary component. Expected stdout: '(3-4i)\n'.

Formal Syntax & Structure

go syntaxgo
func Conj(x complex128) complex128

Parameters & Attributes

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

Return Value

complex128

Complex conjugate: negates imaginary component.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/cmplx")
func main() {  fmt.Println(cmplx.Conj(3 + 4i))}
Go Reference