subtract#
- class saiunit.math.subtract(x, y, **kwargs)#
Subtract arguments, element-wise.
- Parameters:
x (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – The arrays to be subtracted from each other. Ifx.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output).y (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) – The arrays to be subtracted from each other. Ifx.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output).
- Returns:
subtract – The difference of x and y, element-wise. This is a scalar if both x and y are scalars.
- Return type:
saiunit.Quantity |
Array
Examples
>>> import saiunit as u >>> a = [4, 5, 6] * u.meter >>> b = [1, 2, 3] * u.meter >>> u.math.subtract(a, b)