greater

Contents

greater#

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

Return (x > y) element-wise.

When both x and y are Quantities, y is converted to the unit of x before comparison.

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 – Element-wise greater-than comparison.

Return type:

bool | Array

Examples

>>> import saiunit as u
>>> import jax.numpy as jnp
>>> u.math.greater(jnp.array([3, 2, 1]), jnp.array([1, 2, 3]))
Array([ True, False, False], dtype=bool)
>>> a = jnp.array([2.0, 1.0]) * u.meter
>>> b = jnp.array([1.0, 2.0]) * u.meter
>>> u.math.greater(a, b)
Array([ True, False], dtype=bool)