EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 167

Radio Shack TRS-80 Model 4
418 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Operators
An operator is the single symbol or word which signifies some action
to be taken on either one or two specified values referred to as
operands.
In
general, an operator is used like this:
operand-1 operator operand-2
6 + 2
The addition operator + connects or relates its two operands, 6 and
2,
to produce the result
8.
Operand-1 and -2 can be expressions.
Afew
operations take only one operand, and are used like this:
operator operand
5
The negative operator - acts on single operand 5 to produce the
result negative
5.
Neither 6 + 2 nor - 5 can stand alone; they must be used
in
statements to be meaningful to BASIC. For example:
A = B + 2
PRINT
-5
Operators fall into four categories:
Numeric
String
Relational
Logical
based on the kinds of operands they require and the results they
produce.
Numeric Operators
Numeric Operators are used
in
numeric expressions. Their operands
must always be numeric, and the results they produce is one numeric
data item.
In
the description below, we use the terms integer, single-precision,
and double-precision operations. Integer operations involve two-byte
operands, single-precision operations involve four-byte operands, and
double-precision operations involve eight-byte operands. The more
bytes involved, the slower the operation.
There are five different numeric operators. Two of them, sign
+ and
sign
-,
are unary, that is, they have only one operand. A sign
operator has no effect on the precision of its operand.
2-39

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals