View source code Display the source code in std/complex.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

Module 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.

Functions

Name Description
abs Calculates the absolute value (or modulus) of a complex number.
arg Calculates the argument (or phase) of a complex number.
complex Helper function that returns a complex number with the specified real and imaginary parts.
conj Returns the complex conjugate of a complex number.
cos Trigonometric functions.
expi Calculates cos(y) + i sin(y).
fromPolar Constructs a complex number given its absolute value and argument.
sin Trigonometric functions.
sqAbs Calculates the squared modulus of a complex number. For genericity, if called on a real number, sqAbs returns its square.
sqrt Square root.

Structs

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

Authors

Lars Tandle Kyllingstad, Don Clugston

License

Boost License 1.0

Comments