EasyManua.ls Logo

Commodore VIC-20 - Numbers and Variables

Commodore VIC-20
308 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...
NUMBERS
AND
VARIABLES
The
numbers
printed
by
VIC
20
are
governed
by
limitations
wfthin
their
formats.
The
numbers
are stored
internally
to
over
ten
digits
of
accuracy.
However,
when
a
number
is
printed,
only
nine
digits
are
displayed.
Each
number
may
also
have
an
exponent
(a
power-of-ten
scalrng
factor).
Numbers
are
used
all
the
time
when
working
with
VIC
20.
There
are
two
kinds
of
numbers
that
can
be
stored:
floating
point
numbers
(also
called
real
numbers)
and
integers.
Floating
point
is
the
standard
number
representation
used
by
the
VIC.
The
VIC
does
its
arithmetic
using
floating
point
numbers.
A
floating
point
number
can
be
a
whofe
number,
a
fractional
number
preceded
by a decimal
point,
or
a
combination.
The
number
can
be
signed
negative
(-)
or
positive
(-).
If
the
number
has
no
sign,
it
is
assumed
to
be
positive.
Consider
the
following
examptes
of
floating
point
numbers:
Whole
number
equivalent
to
an
integer:
5
-15
65000
161
0
Numbers
with
a
decimal
point;
0.5
0.0165432
-0.00009
1.6
24.0085
-65.6
3.1416
Notice
that
if
you
put
a
comma
in
a
number
and
ask
the
VIC
to
assign
it
to
a
variable,
you
will
get
a
Syntax
Error
message.
For
example,
you
must
use
65000,
not
65,000.
Numbers
always
have
at
least
eight
digits of
precision;
they
can
have
up
to
nine,
depending
on
the
number.
The
VIC
rounds
any
additional
significant
digits,
it
rounds
up
when
the
next
digit
is
five
or
more;
it
rounds
down
when
the
nex1
digit
is
four
or
less.
Rounding
numbers
wilt
sometimes
cause
fractional
numbers
to
look
inaccurate.
Here
are
some
examples:
54
i

Other manuals for Commodore VIC-20

Related product manuals