rem
Remainder of division (truncated, sign of dividend).
Syntax
Section titled “Syntax”C = rem(A, B)Description
Section titled “Description”Returns A - fix(A/B) * B. The result has the same sign as A (rem(-5, 3) = -2, not 1). Use mod for the always-positive form.
Examples
Section titled “Examples”rem(7, 3) % 1rem(-7, 3) % -1 (sign of dividend)