# tensorplay.functional.remainder Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.remainder.html ```python tensorplay.functional.remainder(input, other, *, out=None) → Tensor ``` Computes [Python’s modulus operation](https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations) entrywise. The result has the same sign as the divisor other and its absolute value is less than that of other. It may also be defined in terms of tensorplay.div() as ``` tensorplay.remainder(a, b) == a - a.div(b, rounding_mode="floor") * b ``` Supports [broadcasting to a common shape](/docs/notes/broadcasting.html#broadcasting-semantics), type promotion, and integer and float inputs. > **Note** > > Complex inputs are not supported. In some cases, it is not mathematically possible to satisfy the definition of a modulo operation with complex numbers. See tensorplay.fmod() for how division by zero is handled. > **See also** > > tensorplay.fmod() which implements C++’s std::fmod. This one is defined in terms of division rounding towards zero. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor) or [Scalar](/docs/generated/tensorplay.Scalar.html#tensorplay.Scalar)) – the dividend - other ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor) or [Scalar](/docs/generated/tensorplay.Scalar.html#tensorplay.Scalar)) – the divisor Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> tensorplay.remainder(tensorplay.tensor([-3., -2, -1, 1, 2, 3]), 2) tensor([ 1., 0., 1., 1., 0., 1.]) >>> tensorplay.remainder(tensorplay.tensor([1, 2, 3, 4, 5]), -1.5) tensor([ -0.5000, -1.0000, 0.0000, -0.5000, -1.0000 ]) ```