expressions
ARES System Manual: exec Shell

Two built-in commands from the exec shell, if and set, allow for parsing of mathematical operations, called expressions.

For example:

    set x = $x + 1

    if $y / 2 == 2 then jump my_label

Expressions in exec code permit the following operators: !=, ==, <, >, <=, >=, +, -, *, and /.

To compare strings, use is:

    if $arg.1 is abort then exit

As with other exec commands, $ can be used to retrieve the value of a variable from the env section of the database. See set.

There is no operator precedence; expressions are parsed from left to right. Structure your equations accordingly, and use a temporary variable via set for more complex procedures.

Expressions use floating-point evaluation but comparisons will clamp to integer values within ±0.001.

For more sophisticated mathematical facilities, see the lslisp and calc programs.