Determine the remainder from a division.
REM(num, den)
num |
- |
A scalar, series, or table. The numerator value. |
den |
- |
A scalar, series, or table. The denominator value. |
A scalar, series, or table.
rem(5,3)
returns 2.
W1: 1..10
W2: ravel(W1,5)
rem(W1,5)
returns the series: {1,2,3,4,0,1,2,3,4,0}
rem(W2,5)
returns the 5x2 array:
{{1, 1},
{2, 2},
{3, 3},
{4, 4},
{0, 0})
rem(12.3, 3) returns 0.3
rem(-12.3, 3) returns –0.3
mod(-12.3, 3) returns –2.7
rem(a, b) has the same sign as a and mod(a, b) has the same sign as b. Both are equal if the inputs have the same sign, but differ by b if the signs differ, i.e.:
rem(-a, b) == mod(-a, b) - b
REM works for scalars, series, and tables.