pred
The predecessor function.
Syntax
-
pred(n[, m[, d]])
-
n
is an integer -
m
is a positive integer -
d
is an integer
-
Description
-
If
n
is an integer, thenpred(n)
is the previous integer, i.e.,n − 1
. -
If, in addition,
m
is a positive integer, thenpred(n, m)
is the previous integer modulom
, i.e.,(n − 1) mod m
. -
If, in addition,
d
is an integer, thenpred(n, m, d)
is the previous integer modulom
in the translated interval[d, d + m)
.
Examples
pred(5)
4
pred(0, 3)
2
pred(5, 3, 4)
4
pred(4, 3, 4)
6