exp¶
- exp(x:array,/)→array¶
Calculates an implementation-dependent approximation to the exponential function for each element
x_iof the input arrayx(eraised to the power ofx_i, whereeis the base of the natural logarithm).Note
For complex floating-point operands,
exp(conj(x))must equalconj(exp(x)).Note
The exponential function is an entire function in the complex plane and has no branch cuts.
- Parameters:
x (array) – input array. Should have a floating-point data type.
- Returns:
out (array) – an array containing the evaluated exponential function result for each element in
x. The returned array must have a floating-point data type determined byType Promotion Rules.
Notes
Special cases
For real-valued floating-point operands,
If
x_iisNaN, the result isNaN.If
x_iis+0, the result is1.If
x_iis-0, the result is1.If
x_iis+infinity, the result is+infinity.If
x_iis-infinity, the result is+0.
For complex floating-point operands, let
a=real(x_i),b=imag(x_i), andIf
ais either+0or-0andbis+0, the result is1+0j.If
ais a finite number andbis+infinity, the result isNaN+NaNj.If
ais a finite number andbisNaN, the result isNaN+NaNj.If
ais+infinityandbis+0, the result isinfinity+0j.If
ais-infinityandbis a finite number, the result is+0*cis(b).If
ais+infinityandbis a nonzero finite number, the result is+infinity*cis(b).If
ais-infinityandbis+infinity, the result is0+0j(signs of real and imaginary components are unspecified).If
ais+infinityandbis+infinity, the result isinfinity+NaNj(sign of real component is unspecified).If
ais-infinityandbisNaN, the result is0+0j(signs of real and imaginary components are unspecified).If
ais+infinityandbisNaN, the result isinfinity+NaNj(sign of real component is unspecified).If
aisNaNandbis+0, the result isNaN+0j.If
aisNaNandbis not equal to0, the result isNaN+NaNj.If
aisNaNandbisNaN, the result isNaN+NaNj.
where
cis(v)iscos(v)+sin(v)*1j.Changed in version 2022.12:Added complex data type support.