EasyManuals Logo

Sharp MZ-800 User Manual

Sharp MZ-800
221 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
Page #47 background imageLoading...
Page #47 background image
5.5
Array
Variables
An
array
is
an
arrangement
of
variables
of
the
same
data
type,
which
are
referred
to
by
a
common
name.
Each
variable
of
an
array
is
identified
by
the
common
name,
which
is
composed
of
a
string
formed
in
the
same
manner
as
a
variable
name
and
followed
by
subscripts
enclosed
within
parenthese,
e.g.,
A(X)
and
BS(x,y).
An
array
with
one
subscript
(such
as
A(X),
B$(1)
or
P(100))
is
called
a
one-
dimensional
array,
while
that
with
two
subscripts
(such
as
A(x,y),
B$(1,3)
or
P(50,25))
is
called
a
two-
dimensional
array.
To
use
array
variables
in
a
program,
the
common
name
and
the
number
of
varia-
bles
included
in
the
array
must
be
declared
before
they
are
used.
For
details
see
the
explanation
of
the
DIM
statement
in
Chapter
6.
*
Note
Concerning
Computational
Error
Computational
error
must
always
be
taken
into
consideration
whenever
a
computer
is
used.
The
reason
for
this
is
that,
although
computational
error
can
be
reduced
by
increasing
the
number
of
digits
of
numerical
data
which
are
handled,
not
even
a
computer
can
handle
an
infinite
number
of
digits.
Further,
the
more
digits
are
involved
in
any
given
calculation,
the
greater
the
amount
of
time
which
is
involved
in
completing
it.
Therefore,
it
is
important
to
be
aware
of
the
sources
of
error
and
to
construct
programs
so
that
error
is
minimized.
(For
example,
use
the
sequence
‘5
*6/3”’
instead
of
“*5/3*6"’.)
Take
the
following
into
account
when
doing
calculations
in
BASIC
(1Z016)
for
the
MZ-800.
(1)
Rounding
error
Rounding
error
is
the
error
which
results
when
the
number
of
digits
to
the
right
of
the
decimal
place
exceed
the
number
of
effective
digits
which
can
be
handled.
For
example,
when
the
num-
ber
2/3
is
calculated,
the
true
result
is
0.666666666.
. .
(where
the
number
of
6s
is
infinite).
However,
if
the
number
of
effective
digits
is
8,
the
result
will
be
rounded
to
0.66666667.
(2)
Error
resulting
upon
conversion
to
binary
form
Although
numbers
are
ordinarily
input
in
decimal
format,
they
are
internally
converted
to
bi-
nary
form
for
calculation.
According,
a
binary
number
with
an
infinite
number
of
digits
may
result
upon
conversion
even
if
the
original
decimal
number
only
has
a
few
digits.
For
example,
when
the
decimal
number
0.1
is
converted
to
binary
form,
the
result
is
0.00011001100.
.
.
.
Since
this
must
be
rounded
for
calculation,
a
certain
amount
of
error
results.
(3)
Increase
in
relative
error
due
to
subtraction
When
one
number
is
subtracted
from
another,
the
relative
size
of
the
error
in
the
result
will
be
greater
than
that
in
the
original
numbers.
This
is
illustrated
in
the
example
below,
where
the
digits
which
include
error
are
marked
with
a
dot
(.).
An
error
of
+1
in
the
number
100012
corresponds
to
an
error
percentage
of
about
0.001%;
however,
relative
error
is
much
greater
after
subtraction,
since
11
+1
corresponds
to
a
relative
error
of
about
10%.
100012
~
100001
i
(4)
Error
due
to
approximation
With
a
computer,
exponentiation,
trigonometric
calculations,
and
logarithmic
calculations
are
done
using
approximation;
in
consequence,
a
certain
amount
of
approximation
error
results
when
such
calculations
are
done.
5-6

Other manuals for Sharp MZ-800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sharp MZ-800 and is the answer not in the manual?

Sharp MZ-800 Specifications

General IconGeneral
BrandSharp
ModelMZ-800
CategoryDesktop
LanguageEnglish

Related product manuals