Arithmetic Operators; Logical Operators - Sharp MZ-80B Basic Manual

Personal computer double precision disc
Hide thumbs Also See for MZ-80B:
Table of Contents

Advertisement

3.1 .21

Arithmetic operators

The number to the left of each operator indicates its operational priority. Any group of operations enclosed in
parentheses has first priority.
x · y
• ·
1 0 A =
(j -
1 0 A = -B (negative sign)
• *
1 0 A = X*Y
(multiplication)
8 /
1 0 A = X/Y (division)
e +
1 0 A = X + Y (addition)
1 0 A = X - Y (subtraction)
3. 1 .22

Logical operators

l 0 IF A = X THEN ...
20 I F A$ = "XYZ"
THEN ...
<> or ><
10 IF A <> X THEN ...
> = or = >
10 I F A > = X THEN ...
1 0 I F A <= X THEN ...
< = or = <
*
40 IF (A>X) * (B >Y)
THEN ...
+
50 IF (A> X) + (B> Y)
THEN ...
(power)
Substitutes
integer, an e rror results.)
Note that "-" in -B is the negative sign and "-" in 0-B represents
subtraction.
Multiplies X by Y and substritutes the result in to variable A.
Divides X by Y and substitutes the result into variable A.
Adds X and Y and substitutes the result into variable A.
Subtracts X from Y and substitutes the result into variable A.
If the value of variable A is equal to X , the statement following
THEN is executed.
If the content o f variable A$ is "XYZ" , the statement following
THEN is executed.
If the value of variable A is not equal to X, the statement following
THEN is executed.
If the value of variable A is greater than or equal to X, the state­
ment following THEN is executed.
If the value of variable A is less than or equal to X, the statement
following THEN is executed.
If the value of variable A is greater than X and the value of variable
B is greater than Y, the statement following THEN is executed.
If the value of variable A is greater than X or the value of variable
B is greater than the value of Y, the statement following to THEN
is executed.
x Y
into variable A. (If X is negative and Y is not an
5 9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents