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