jax.lax.rem — JAX documentation (original) (raw)

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:

Returns:

An array of the same dtype as x and y containing the remainder.

Return type:

Array