right_shift

Contents

right_shift#

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

Shift the bits of an integer to the right, 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 right shift.

Return type:

Array

Examples

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