logical_and

Contents

logical_and#

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

Compute the truth value of x AND 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 AND result.

Return type:

bool | Array

Examples

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