increment function
Add 1 to a variable in place and return its old value.
How to write it
increment(name)
- name
- The variable to update. Takes a variable.
Examples
a := 1; increment(a); aIn the solver,
Open in the solvera := 1; increment(a); agives2.
Related functions
- pre_increment
Add 1 to a variable in place and return the new value.
- indicator
A condition as a number: 1 when it is true and 0 when it is false.
- ifelse
A value chosen by a test.
- piecewise
Cases written value if condition, with an optional otherwise case.
- function
A function with no name; also written x => body.
- pre_decrement
Subtract 1 from a variable in place and return the new value.