reciprocal#
- class saiunit.math.reciprocal(x, **kwargs)#
Return the reciprocal of the argument, element-wise.
Calculates
1/x. When the input carries a unit, the result carries the inverse of that unit.- Parameters:
x (
Union[saiunit.Quantity,Array,ndarray,number,bool]) – Input array.- Returns:
y – Return array with the same shape as x. This is a scalar if x is a scalar. This is a Quantity if the unit of x is not dimensionless; the resulting unit is
1 / x.unit.- Return type:
Union[saiunit.Quantity,Array]
Examples
>>> import saiunit as u >>> result = u.math.reciprocal(u.math.array([2.0, 4.0]) * u.second) >>> result.mantissa # array([0.5 , 0.25])