pre_decrement function
Subtract 1 from a variable in place and return the new value.
How to write it
pre_decrement(name)
- name
- The variable to update. Takes a variable.
Examples
a := 1; pre_decrement(a)In the solver,
Open in the solvera := 1; pre_decrement(a)gives0.
Related functions
- pre_increment
Add 1 to a variable in place and return the new value.
- decrement
Subtract 1 from a variable in place and return its old value.
- piecewise
Cases written value if condition, with an optional otherwise case.
- release_hold
Evaluate an expression that was held.
- indicator
A condition as a number: 1 when it is true and 0 when it is false.
- set
Assign a value to a name; also written name := value.