true_divide

Contents

true_divide#

class brainunit.math.true_divide(x, y, **kwargs)#

Return a true division of the inputs, element-wise.

Equivalent to divide. The resulting unit is x.unit / y.unit.

Parameters:
  • x (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Dividend array.

  • y (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Divisor array. If x.shape != y.shape, they must be broadcastable to a common shape.

Returns:

out – The quotient x / y, element-wise. This is a scalar if both x and y are scalars. The resulting unit is x.unit / y.unit.

Return type:

saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex

Examples

>>> import saiunit as u
>>> a = u.math.array([10.0, 20.0]) * u.meter
>>> b = u.math.array([2.0, 5.0]) * u.second
>>> u.math.true_divide(a, b)  # unit is meter / second