left_shift

Contents

left_shift#

class saiunit.math.left_shift(x, y, **kwargs)#

Shift the bits of an integer to the left, element-wise.

Both inputs must be dimensionless.

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

  • y (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Number of bits to shift.

Returns:

out – Element-wise left shift.

Return type:

Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.left_shift(jnp.array([1, 2]), jnp.array([1, 2]))
Array([2, 8], dtype=int32)