Top
Systemwalker Operation Manager V17.0.1 Reference Guide

15.2.9 expr (Perform an Arithmetic Operation)

Description

Executes an arithmetic operation.

Synopsis

expr arg [arg arg ...]

Option

arg

Specify the expression.

Valid operators (listed in decreasing order of precedence)

- + ~ !

Unary minus, unary plus, complement, logical NOT

* / %

Multiply, divide, remainder

+ -

Add, subtract

A part of expression enclosed in parentheses (()) takes precedence over the others included in the same command and is computed first.

Return Value

The result of operation is returned.

Example

The following example displays the result of 3 x (10 - (4 - 2)).

set result [expr 3*(10-(4-2))]
puts $result

Execution Results/Output Format

24