std.complex

This module contains the Complex type, which is used to represent complex numbers, along with related mathematical operations and functions.

Complex will eventually replace the built-in types cfloat, cdouble, creal, ifloat, idouble, and ireal.

Members

Functions

abs
T abs(Complex!T z)
acos
Complex!T acos(Complex!T z)

Inverse trigonometric functions on complex numbers.

acosh
Complex!T acosh(Complex!T z)

Inverse hyperbolic trigonometric functions on complex numbers.

arg
T arg(Complex!T z)
asin
Complex!T asin(Complex!T z)

Inverse trigonometric functions on complex numbers.

asinh
Complex!T asinh(Complex!T z)

Inverse hyperbolic trigonometric functions on complex numbers.

atan
Complex!T atan(Complex!T z)

Inverse trigonometric functions on complex numbers.

atanh
Complex!T atanh(Complex!T z)

Inverse hyperbolic trigonometric functions on complex numbers.

complex
auto complex(R re)
auto complex(R re, I im)

Helper function that returns a complex number with the specified real and imaginary parts.

conj
Complex!T conj(Complex!T z)
cos
Complex!T cos(Complex!T z)

Trigonometric functions on complex numbers.

cosh
Complex!T cosh(Complex!T z)

Hyperbolic trigonometric functions on complex numbers.

coshisinh
Complex!real coshisinh(real y)
exp
Complex!T exp(Complex!T x)

Calculates ex.

expi
Complex!real expi(real y)
fromPolar
Complex!(CommonType!(T, U)) fromPolar(T modulus, U argument)

Constructs a complex number given its absolute value and argument.

log
Complex!T log(Complex!T x)

Calculate the natural logarithm of x. The branch cut is along the negative axis.

log10
Complex!T log10(Complex!T x)

Calculate the base-10 logarithm of x.

norm
T norm(Complex!T z)

Extracts the norm of a complex number.

pow
Complex!T pow(Complex!T x, Int n)
Complex!T pow(Complex!T x, T n)
Complex!T pow(Complex!T x, Complex!T y)
Complex!T pow(T x, Complex!T n)

Calculates xn. The branch cut is on the negative axis.

proj
Complex!T proj(Complex!T z)

Returns the projection of z onto the Riemann sphere.

sin
Complex!T sin(Complex!T z)

Trigonometric functions on complex numbers.

sinh
Complex!T sinh(Complex!T z)

Hyperbolic trigonometric functions on complex numbers.

sqAbs
T sqAbs(Complex!T z)
T sqAbs(T x)
sqrt
Complex!T sqrt(Complex!T z)
tan
Complex!T tan(Complex!T z)

Trigonometric functions on complex numbers.

tanh
Complex!T tanh(Complex!T z)

Hyperbolic trigonometric functions on complex numbers.

Structs

Complex
struct Complex(T)

A complex number parametrised by a type T, which must be either float, double or real.

Meta

Authors

Lars Tandle Kyllingstad, Don Clugston