floor_divide

Contents

floor_divide#

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

Return the largest integer smaller or equal to the division of the inputs.

Equivalent to the Python // operator. The resulting unit is x.unit / y.unit.

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

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

Returns:

outfloor(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

Examples

>>> import saiunit as u
>>> a = u.math.array([7.0, 8.0]) * u.meter
>>> b = u.math.array([2.0, 3.0]) * u.second
>>> u.math.floor_divide(a, b)  # unit is meter / second