The OpenD Programming Language

exp

Calculates ex.

@trusted pure nothrow @nogc
exp
(
T
)

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 std.math.operations : isClose;
import std.math.constants : 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.0L, 1.0L) * PI);
assert(isClose(b, -1.0L, 0.0, 1e-15));

Meta