There is 1 other file named tecexp.rnm in the archive. Click here to see a list.
Expressions in TECO do not follow the normal rules for evaluation. That
is the expression 2+1*3 does not have the same result in FORTRAN as it does
in TECO. This chapter will explain how expressions in TECO differ from
those found in the normal programming languages (FORTRAN, BASIC, etc.).
Expressions are evaluated from left to right in TECO. That is
the expression 2+1*3 will first do the addition and then the multiplication.
The result of this expression is 9, while programming languages like
FORTRAN would produce the result of 5. If the user wishes to override the
normal evaluation the user can enclose the expression in parentheses that
is to be evaluated first. An example of this is the expression 2+(1*3)
will cause the 1*3 to be evaluated first then 2 will be added to the result
of the multiplication.
TECO contains the normal addition, subtraction, division and multiplication
operators. Additionally it has operators for logical AND and logical OR.
An operator may appear between any two values.
A common user error is to have a unary minus after some command
that returned a value. That is a command that returned either
a true or false value. TECO will cause the minus to become a
subtraction instead of the unary operator because of the returned value.
The addition operator in TECO is the plus sign, "+". The operator
must appear between two values.
.hl2 Unary plus
The unary plus operator in TECO is the plus sign, "+". The operator must
appear before a single value to be considered the unary operator.
The subtraction operator in TECO is the minus sign, "_-". The operator
appears between two values. If the operator is before an operator then it
is not a subtraction operator, but the unary minus operator.
.hl2 Unary minus
.hl2 Logical AND
.hl2 Logical OR