NET/MASTER Network Control Language (NCL) Reference Manual

Arithmetic Operators and Expressions
Expressions and Operators
10–12 106126 Tandem Computers Incorporated
Addition Operator (+)
The addition operator (+) adds the left term of an expression to the right term. Both
terms must represent valid numbers.
The general syntax for using the addition operator is:
term
+
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 = 2 + 2 &a has the value 4.
&a = 3 + 2 &a has the value 5.
Subtraction Operator (-)
The subtraction operator (-) subtracts the right term of an expression from the left
term. Both terms must represent valid numbers.
The general syntax for using the subtraction operator is:
term
-
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 = 2 - 2 &a has the value 0.
&a = 3 - 2 &a has the value 1.
Arithmetic Expressions An arithmetic expression gives the mathematical result of a calculation. The result is
placed in a variable.
NCL treats numbers as real numbers. These are either integers or numbers containing
a decimal. NCL uses floating-point arithmetic to evaluate arithmetic expressions.
Results are maintained in scientific notation. For example, the number 22.8 is held in a
variable as +.22800000000000e+02, which means 0.228 times 10 to the power of 2.