jax.lax.rem#
- jax.lax.rem(x, y)[source]#
Elementwise remainder: \(x \bmod y\).
This function lowers directly to the stablehlo.remainder operation. The sign of the result is taken from the dividend, and the absolute value of the result is always less than the divisor’s absolute value.
Integer division overflow (remainder by zero or remainder of INT_SMIN with -1) produces an implementation defined value.
- Parameters:
x (ArrayLike) – Input arrays. Must have matching int or float dtypes. If neither is a scalar,
xandymust have the same number of dimensions and be broadcast compatible.y (ArrayLike) – Input arrays. Must have matching int or float dtypes. If neither is a scalar,
xandymust have the same number of dimensions and be broadcast compatible.
- Returns:
An array of the same dtype as
xandycontaining the remainder.- Return type:
See also
jax.numpy.remainder(): NumPy-style remainder with different sign semantics.