equal#
- class saiunit.math.equal(x, y, *args, **kwargs)#
Return
(x == y)element-wise.When both
xandyare Quantities,yis converted to the unit ofxbefore comparison. ATypeErroris raised if only one operand has units.- Parameters:
- Returns:
out – Element-wise equality comparison.
- Return type:
bool|Array
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> u.math.equal(jnp.array([1, 2, 3]), jnp.array([1, 0, 3])) Array([ True, False, True], dtype=bool) >>> a = jnp.array([1.0, 2.0]) * u.meter >>> b = jnp.array([1.0, 2.0]) * u.meter >>> u.math.equal(a, b) Array([ True, True], dtype=bool)