NET/MASTER Network Control Language (NCL) Reference Manual

Arithmetic Operators and Expressions
Expressions and Operators
106126 Tandem Computers Incorporated 10–9
Unary Minus Operator (-)
The unary minus operator (-) inverts the value of the numeric term to which it is
adjacent; that is, a positive value is changed to a negative value, and a negative value
is changed to a positive value. The term must represent a valid number. The unary
minus operator forces a term to be numerically interpreted.
The general syntax for using the unary minus operator is:
-
term
term
specifies a term in an expression. Terms are defined at the beginning of this
section under “The Composition of Expressions.”
Some examples are listed in the following table:
What You Type Result
&a = 1 + -1 &a has the value 0 (zero).
say -+99 The symbol -99 is displayed.
say --99 The symbol 99 is displayed.
Exponentiation Operator (**)
The exponentiation operator (**) raises the left term of an expression to a power
determined by the term at the right. The term and the power must represent valid
numbers. The power must be an integer.
The general syntax for using the exponentiation operator is:
term
**
power
term
specifies a term in an expression. Terms are defined at the beginning of this
section under “The Composition of Expressions.”
power
specifies a power in an expression. See the exponentiation operator, described
previously in this section.
Some examples are listed in the following table:
What You Type Result
&a = 2 ** 2 &a has the value 4.
&a = 5 ** 3 &a has the value 125.