bitwise_xor

Contents

bitwise_xor#

class brainunit.math.bitwise_xor(x, y, **kwargs)#

Compute bit-wise XOR of two arrays, element-wise.

Both inputs must be dimensionless.

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

  • y (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Second input.

Returns:

out – Element-wise bit-wise XOR.

Return type:

Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.bitwise_xor(jnp.array([True, False]),
...                     jnp.array([True, True]))
Array([False,  True], dtype=bool)