Array API compatible wrapper for :py:func:`np.subtract `. See its docstring for more information.
(x1: Array, x2: Array, /)
| 716 | |
| 717 | |
| 718 | def subtract(x1: Array, x2: Array, /) -> Array: |
| 719 | """ |
| 720 | Array API compatible wrapper for :py:func:`np.subtract <numpy.subtract>`. |
| 721 | |
| 722 | See its docstring for more information. |
| 723 | """ |
| 724 | if x1.dtype not in _numeric_dtypes or x2.dtype not in _numeric_dtypes: |
| 725 | raise TypeError("Only numeric dtypes are allowed in subtract") |
| 726 | # Call result type here just to raise on disallowed type combinations |
| 727 | _result_type(x1.dtype, x2.dtype) |
| 728 | x1, x2 = Array._normalize_two_args(x1, x2) |
| 729 | return Array._new(np.subtract(x1._array, x2._array)) |
| 730 | |
| 731 | |
| 732 | def tan(x: Array, /) -> Array: |