ldexp#
- class brainunit.math.ldexp(x, y, unit_to_scale=None, **kwargs)#
Returns x * 2**y, element-wise.
The mantissas x and twos exponents y are used to construct floating point numbers
x * 2**y.- Parameters:
x (saiunit.Quantity |
Array|ndarray|number|bool) – Array of multipliers. May carry any unit; the result keeps it, sincex * 2**yonly rescales the magnitude.y (saiunit.Quantity |
Array|ndarray|number|bool) – Array of twos exponents. Must be dimensionless with integral values. Ifx.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output).unit_to_scale (saiunit.Unit |
None) – Unit used to convertx(noty) to a dimensionless number first (kept for backwards compatibility; the result is then a plain array).
- Returns:
out – The result of
x * 2**y, carryingx’s unit whenxis a Quantity andunit_to_scaleis not given. This is a scalar if both x and y are scalars.- Return type:
Array