package cmplx
Import Path
math/cmplx (on golang.org and go.dev)
Dependency Relation
imports 2 packages, and imported by 0 packages
Involved Source Files
d-> abs.go
asin.go
conj.go
exp.go
isinf.go
isnan.go
log.go
phase.go
polar.go
pow.go
rect.go
sin.go
sqrt.go
tan.go
Exported Values
func
Inf()
complex128
Inf returns a complex infinity, complex(+Inf, +Inf).
func
IsNaN(x
complex128)
bool
IsNaN reports whether either real(x) or imag(x) is NaN
and neither is an infinity.
func
NaN()
complex128
NaN returns a complex ``not-a-number'' value.
func
Phase(x
complex128)
float64
Phase returns the phase (also called the argument) of x.
The returned value is in the range [-Pi, Pi].
func
Polar(x
complex128) (r, θ
float64)
Polar returns the absolute value r and phase θ of x,
such that x = r * e**θi.
The phase is in the range [-Pi, Pi].
func
Pow(x, y
complex128)
complex128
Pow returns x**y, the base-x exponential of y.
For generalized compatibility with math.Pow:
Pow(0, ±0) returns 1+0i
Pow(0, c) for real(c)<0 returns Inf+0i if imag(c) is zero, otherwise Inf+Inf i.
func
Sqrt(x
complex128)
complex128
Sqrt returns the square root of x.
The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x).