Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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)  0\displaystyle a := 1;\; \operatorname{pre\_decrement}(a) \; 0
    a := 1; pre_decrement(a)

    In the solver, a := 1; pre_decrement(a) gives 0.

    Open in the solver
  • 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.