EasyManua.ls Logo

Sharp MZ-700 - Page 28

Sharp MZ-700
213 pages
Print Icon
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...
2.2.4 BASIC Operations
In BASIC, arithmetic operations take a slightly different form
than
is the case with ordinary arithmetic.
The various arithmetic operators used in
BASIC are shown in the table below. The priority
of
these
operators when
they
are used together within a single expression (the sequence in which
the
different
arithmetic operations are performed) is
as
indicated
by
the numbers in the left column
of
the
table;
however, operators within parentheses always have the highest priority.
Arithmetic operations
. -
Operator Operation
Format
1 t
Exponentiation
X
t Y (Indicates
xv;
i.e.; X
to
the
Yth
power.)
2 -
Negation
-X
..
Multiplication,
X
* Y (X times Y),
X/Y
(~;i.e.,
X divided
by
Y)
3
*,
1
division
4
+ -
,
Plus, minus
X+
Y (X plus Y),
X-
Y (X minus Y)
(Example 1)
1 0
A
=3*8
/
4·············
··
······When a series
of
operators with the same priority are used in
an arithmetic expression, calculations are carried
out
from left
to
right; thus,
the
result
of
the expression at left is 6.
(Example
2)
1 0 A
=6
0
-6*8+2············Result
is 14.
20
8=
(
60-6)
*8
+2···
···Result
is
434.
(Example 3)
10
A=2i3
····· Assigns 2
to
the 3rd power to A; result is 8.
String operations
String operations are used to create new strings
of
character
data
by
concatenating (linking)
two
or
more shorter strings. The only
operator
which can be used in string operations is
the"+"
sign.
(Example)
PRINT
"
ABC
" + "
DEF
" J
Displays the character string "ABCDEF".
26------
--
----
------------
----
--------------------------
--
--------
-----

Other manuals for Sharp MZ-700

Related product manuals