float_power#
- class brainunit.math.float_power(x, y, **kwargs)#
First array elements raised to powers from second array, element-wise.
Like
power(), but integers, float16, and float32 are promoted to floats with a minimum precision of float64 so that the result is always inexact. The exponent must be dimensionless.- Parameters:
- Returns:
out – The bases in x raised to the exponents in y. This is a scalar if both x and y are scalars. The resulting unit is
x.unit ** y.- Return type:
saiunit.Quantity |
Array- Raises:
TypeError – If y is a Quantity that is not dimensionless.
Examples
>>> import saiunit as u >>> q = u.math.array([2.0, 3.0]) * u.meter >>> u.math.float_power(q, 2) # unit is meter ** 2