EasyManua.ls Logo

Commodore Plus 4 - Numeric Functions

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...
NUMERIC
Included
in
your
Plus/4
BASIC
3.5
language
are
numeric
functions.
FUNCTIONS
wn'cn
are
like
lne
advanced
calculations
found
on
most
scientific
cal
culators
(such
as
sine,
cosine,
tangent, etc
)
Most
of
the
functions
can
be
used
by
typing
the
name
of
the
function
and
the
number
to
be
operated
by
the
formula
in
parentheses,
like
this.
FUNCTION(X)
For
example,
to
find
out the
sine
of
a
variable,
you
would
type
PRINT
SIN(X)
with
X
as
any
number
you
want
to
input
You
could
also
include
one
of
the
functions
in
a
program
line,
as
the
following
example
shows.
10FORX=lTO5
20
PRINT
"THE
SQUARE
ROOT
OF":
X;"IS";
SQR(X)
30
NEXT
X
There
is
a
complete
listing
of
the
numeric
functions
in
the
BASIC
3.5
Encyclopedia.
Some
of
the
more
complex
functions
are
explained
in
the
following
paragraphs.
RANDOM
NUMBERS
AND
OTHER
FUNCTION
Selecting
a
random number
is
Itke
taking
10
pieces
of
paper,
writing
a
number
from
1
to
10
on
each
piece
and
putting
the
10
pieces
of
paper
into
a hat
and
drawing
one
piece
of
paper.
The
number
chosen
is
a
RANDOM
number.
The
number
is
put
back
into
the
hat.
and
another
number
is
drawn.
Each
time
a
number
is
drawn,
it
is
put
back
in
the
hat.
keeping
the
pool
of
possible
numbers
the
same.
When
a
number
is
selected,
there
is
no
way
of
knowing what
number
is
going
to
come
up
next,
but
you
do
know
that
the
number
will
be
between
1
and
10
This
is
the
basis
of
RANDOM
NUMBERS
Random
numbers
are
extremely
useful
in
programming,
providing
the
element
of
chance
or
(obviously)
randomness.
Random
numbers
usu
ally
have
a
range,
meaning
theres an
upper
limit
and
a
lower
limit
to
the
numbers
you
can
draw.
In
the hat
example,
the
range
of
numbers
is
1
to
10.
The
lower
limit
is
"1"
and
the
upper
limit
is
"10",
which
means
that
any
number
from
1
to
10
can
come
up
randomly
each
time
a
new
number
is
selected.
._
65

Other manuals for Commodore Plus 4

Related product manuals