You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update ignore file
* Add complex number support to `exp`
* Update input and output data types
* Update description to accommodate complex number input
* Add note concerning complex conjugation
* Specify special case in terms of `cis` function
* Fix special cases and move note
* Fix `cis` argument
- If ``x1_i`` is greater than ``0``, ``x1_i`` is a finite number, and ``x2_i`` is ``-infinity``, the result is an implementation-dependent approximation to ``+π``.
224
224
- If ``x1_i`` is less than ``0``, ``x1_i`` is a finite number, and ``x2_i`` is ``+infinity``, the result is ``-0``.
225
225
- If ``x1_i`` is less than ``0``, ``x1_i`` is a finite number, and ``x2_i`` is ``-infinity``, the result is an implementation-dependent approximation to ``-π``.
226
-
- If ``x1_i`` is ``+infinity`` and ``x2_i`` is finite, the result is an implementation-dependent approximation to ``+π/2``.
227
-
- If ``x1_i`` is ``-infinity`` and ``x2_i`` is finite, the result is an implementation-dependent approximation to ``-π/2``.
226
+
- If ``x1_i`` is ``+infinity`` and ``x2_i`` is a finite number, the result is an implementation-dependent approximation to ``+π/2``.
227
+
- If ``x1_i`` is ``-infinity`` and ``x2_i`` is a finite number, the result is an implementation-dependent approximation to ``-π/2``.
228
228
- If ``x1_i`` is ``+infinity`` and ``x2_i`` is ``+infinity``, the result is an implementation-dependent approximation to ``+π/4``.
229
229
- If ``x1_i`` is ``+infinity`` and ``x2_i`` is ``-infinity``, the result is an implementation-dependent approximation to ``+3π/4``.
230
230
- If ``x1_i`` is ``-infinity`` and ``x2_i`` is ``+infinity``, the result is an implementation-dependent approximation to ``-π/4``.
Calculates an implementation-dependent approximation to the exponential function, having domain ``[-infinity, +infinity]`` and codomain ``[+0, +infinity]``, for each element ``x_i`` of the input array ``x`` (``e`` raised to the power of ``x_i``, where ``e`` is the base of the natural logarithm).
522
+
Calculates an implementation-dependent approximation to the exponential function for each element ``x_i`` of the input array ``x`` (``e`` raised to the power of ``x_i``, where ``e`` is the base of the natural logarithm).
523
523
524
524
**Special cases**
525
525
526
-
For floating-point operands,
526
+
For real-valued floating-point operands,
527
527
528
528
- If ``x_i`` is ``NaN``, the result is ``NaN``.
529
529
- If ``x_i`` is ``+0``, the result is ``1``.
530
530
- If ``x_i`` is ``-0``, the result is ``1``.
531
531
- If ``x_i`` is ``+infinity``, the result is ``+infinity``.
532
532
- If ``x_i`` is ``-infinity``, the result is ``+0``.
533
533
534
+
For complex floating-point operands, let ``a = real(x_i)``, ``b = imag(x_i)``, and
535
+
536
+
.. note::
537
+
For complex floating-point operands, ``exp(conj(x))`` must equal ``conj(exp(x))``.
538
+
539
+
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``1 + 0j``.
540
+
- If ``a`` is a finite number and ``b`` is ``+infinity``, the result is ``NaN + NaN j``.
541
+
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
542
+
- If ``a`` is ``+infinity`` and ``b`` is ``+0``, the result is ``infinity + 0j``.
543
+
- If ``a`` is ``-infinity`` and ``b`` is a finite number, the result is ``+0 * cis(b)``.
544
+
- If ``a`` is ``+infinity`` and ``b`` is a nonzero finite number, the result is ``+infinity * cis(b)``.
545
+
- If ``a`` is ``-infinity`` and ``b`` is ``+infinity``, the result is ``0 + 0j`` (signs of real and imaginary components are unspecified).
546
+
- If ``a`` is ``+infinity`` and ``b`` is ``+infinity``, the result is ``infinity + NaN j`` (sign of real component is unspecified).
547
+
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``0 + 0j`` (signs of real and imaginary components are unspecified).
548
+
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``infinity + NaN j`` (sign of real component is unspecified).
549
+
- If ``a`` is ``NaN`` and ``b`` is ``+0``, the result is ``NaN + 0j``.
550
+
- If ``a`` is ``NaN`` and ``b`` is not equal to ``0``, the result is ``NaN + NaN j``.
551
+
- If ``a`` is ``NaN`` and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
552
+
553
+
where ``cis(v)`` is ``cos(v) + sin(v)*1j``.
554
+
555
+
.. note::
556
+
The exponential function is an entire function in the complex plane and has no branch cuts.
557
+
534
558
Parameters
535
559
----------
536
560
x: array
537
-
input array. Should have a real-valued floating-point data type.
561
+
input array. Should have a floating-point data type.
538
562
539
563
Returns
540
564
-------
541
565
out: array
542
-
an array containing the evaluated exponential function result for each element in ``x``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
566
+
an array containing the evaluated exponential function result for each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.
0 commit comments