EasyManua.ls Logo

Commodore Plus 4 - Page 170

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...
__
EXAMPLE:
=
INT{RND(l)*6)+INT(RND(l)t6)
+
2
=
INT(RND(1)*1000)
+
1
=
INT(RND(l)*150)
+
100
Simulates
2
dice.
Number
from
1-1000.
Number
from
100-249.
J
-J
SGN(X)
(sign)
This
function
returns
the
sign,
as
in
positive,
negative,
or
zero,
of
X.
The
result
is
+
1
if
positive,
0
if
zero,
and
-
1
if
negative.
SIN{X)
(sine)
This
is
the
trigonometric
sine
function.
The
result
is
the sine
of
X,
where
Xisan
angle
in
radians.
SQR(X)
(square
root)
This
function
returns
the
square
root of
X,
where
X
is
a
positive
number
or
0.
If
X
is
negative,
an
ILLEGAL
QUANTITY
ERROR
results.
TAN{X)
(tangent)
This
gives
the
tangent
of
X,
where
X
is
an
angle
in
radians.
_
USR(X)
When
Ihis
function
is
used,
the
program
jumps
to
a
machine
language
program
whose
starting
point
is
contained
in
memory
locations
1281
and
1282.
The
parameter
X
is
passed
to
the
machine
language
pro-
gram
in
the
floating
point
accumulator.
Another
number
is
passed
back
to
the
BASIC
program
through
the
calling
variable.
In
other
words,
this
,
allows
you
to
exchange
a
variable
between machine
code
and
BASIC.
See
the
Plus/4
PROGRAMMERS
REFERENCE
GUIDE
for
more
details
on
this,
and
on
machine
language
programming.
VAL(XS)
__
This function
converts
the
string
X$
into
a
number,
and
is
essentially
the
inverse
operation
from
STR$.
The
string
is
examined
from
the
left
most
character
to
the
right,
for
as
many
characters
as
are
in
recog-
nizable
number
format.
If
the
Plus/4
finds
illegal
characters,
only
the
portion
of
the
string
up
to
that
point
is
converted.
—.
EXAMPLE:
10X
=
VAL("123.456")
10X
= VAL("3E03")
10X
=
VAL("12A13B")
161

Other manuals for Commodore Plus 4

Related product manuals