logical_xor

Contents

logical_xor#

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

Compute the truth value of x XOR y element-wise.

When both inputs are Quantities, y is converted to the unit of x before the operation.

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

  • y (saiunit.Quantity | Array | ndarray | bool | number | bool | int | float | complex) – Second input array. Must be broadcastable with x.

Returns:

out – Boolean XOR result.

Return type:

bool | Array

Examples

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