A complex number
The complex base e exponential of x
x | exp(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) |
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));
Calculates ex.