The OpenD Programming Language

exp

Calculates ex.

@trusted pure nothrow @nogc
Complex!T
exp
(
T
)
(
Complex!T x
)

Parameters

x Complex!T

A complex number

Return Value

Type: Complex!T

The complex base e exponential of x

Special Values
xexp(x)
(±0, +0)(1, +0)
(any, +∞)(NaN, NaN)
(any, NaN)(NaN, NaN)
(+∞, +0)(+∞, +0)
(-∞, any)(±0, cis(x.im))
(+∞, any)(±∞, cis(x.im))
(-∞, +∞)(±0, ±0)
(+∞, +∞)(±∞, NaN)
(-∞, NaN)(±0, ±0)
(+∞, NaN)(±∞, NaN)
(NaN, +0)(NaN, +0)
(NaN, any)(NaN, NaN)
(NaN, NaN)(NaN, NaN)

Examples

import mir.math.constant: PI;

assert(exp(complex(0.0, 0.0)) == complex(1.0, 0.0));

auto a = complex(2.0, 1.0);
assert(exp(conj(a)) == conj(exp(a)));

auto b = exp(complex(0.0, 1.0) * double(PI));
assert(approxEqual(b, complex(-1.0), 0.0, 1e-15));

Meta