divide_by function
Divide a variable by a value in place and return the new value.
How to write it
divide_by(name, x)
- name
- The variable to update. Takes a variable.
- x
- The divisor. Takes an expression.
Examples
a := 4; divide_by(a, 2); aIn the solver,
Open in the solvera := 4; divide_by(a, 2); agives2.
Related functions
- evaluate
Evaluate an expression even where it would be held.
- decrement
Subtract 1 from a variable in place and return its old value.
- function
A function with no name; also written x => body.
- construct
Apply a head that is itself computed to arguments, as in f'(0) or (x => body)(a).
- ifelse
A value chosen by a test.
- add_to
Add a value to a variable in place and return the new value.