rem
Remainder after division.
📝Syntax
C = rem(A, B)
📥Input Arguments
Parameter Description
A a variable: dividend
B a variable: divisor
📤Output Arguments
Parameter Description
C result of rem(A, B)
📄Description

C = rem(A, B) computes the remainder of A and B, i.e : A - fix(A ./ B) .* B.

This function manages also negative values.

mod(A, 0) = A , whereas rem(A, 0) = NaN.

mod(A, B) has the sign of B, while rem(A, B) has the sign of A.

mod and rem are equals if A and B have the same sign.

💡Examples
 rem (-1, 3)
mod(-1, 3)
🔗See Also
modfloor
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub