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.flooris not scale-linear, so when x and y share a dimension the operands are aligned tox.unitfirst and the result is a plain (dimensionless) integral value. For mixed dimensions, both operands are folded to magnitude-1 (base) units so the result does not depend on the unit representation; the result then carries the basex.unit / y.unit.- Parameters:
x (saiunit.Quantity |
Array|ndarray|number|bool) – Numerator.y (saiunit.Quantity |
Array|ndarray|number|bool) – Denominator. Ifx.shape != y.shape, they must be broadcastable to a common shape.
- Returns:
out –
floor(x / 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 = 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