EasyManua.ls Logo

Commodore Plus 4 - Page 176

Commodore Plus 4
234 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...
BASIC
Tne
ARITHMETIC
operators
include
the
following
signs:
OPERATORS
+
addition
-
subtraction
*
multiplication
/
division
raising
to
a
power
(exponentiation)
On
a
line
containing
more
than
one
operator,
there
is
a
set
order
in
—*
which
operations
always
occur.
If
several
operators
are
used
together,
the
computer
assigns
priorities
as
follows;
First,
exponentiation,
then
multiplication
and
division,
and
last,
addition
and
subtraction.
If
two
operations
have
the
same
priority,
then
calculations are
performed
in
order
from
left
to
right.
If
you
want
these
operations
to
occur
in
a
dif
ferent
order,
Plus/4
BASIC
allows
you
to
give
a
calculation
a
higher
priority
by
placing
parentheses
around
it.
Operations
enclosed
in
parentheses
will
be
calculated before
any
other
operation
You have
to
make
sure
that
your equations
have
the
same
number
of
left
par
entheses
as
right
parentheses,
or
you
will
get
a
SYNTAX
ERROR
message
when
your
program
is
run.
There
are
also
operators
for
equalities
and
inequalities,
called
RELATIONAL
operators
Arithmetic
operators
always
take
priority
over
relational
operators.
=
is
equal
to
<
is
less
than
>
is
greater
than
< =
or
=<
is
less
than
or
equal
to
>=
or
=>
is
greater
than
or
equal
to
<>
or
><
is
not
equal
to
Finally,
there
are
three
LOGICAL
operators,
with
lower
priority
than
both
arithmetic
and
relational
operators:
AND
OR
NOT
These
are
used most
often
to
join
multiple
formulas
in
IF...
THEN
statements.
When
they
are
used
with
arithmetic
operators,
they
are
evaluated
last
(i.e..
after
+
and
-).
167

Other manuals for Commodore Plus 4

Related product manuals