NET/MASTER Network Control Language (NCL) Reference Manual

Arithmetic Operators and Expressions
Expressions and Operators
106126 Tandem Computers Incorporated 10–11
Integer Division Operator (//)
The integer division operator (//) divides the left term of an expression by the right
term. The terms must represent valid numbers. The result is truncated to an integer.
The general syntax for using the integer division 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 1.
&a = 3 // 2 &a has the value 1.
Remainder Operator (%)
The remainder operator (%) divides the left term of expression by the right term. The
terms must represent valid numbers. The result is truncated to an integer, multiplied
by the divisor and subtracted from the dividend to produce the remainder. See the
provided examples for details.
The general syntax for using this operator is:
term1
%
term2
term1
specifies a term in an expression.
term2
specifies a term in an expression. Terms are defined at the beginning of this
section under “The Composition of Expressions.”
The statement
term1
%
term2
is equivalent to the expression:
term1
- ((
term1
//
term2
) *
term2
)
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.