EasyManua.ls Logo

Apple IIe - Page 148

Apple IIe
320 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...
, 148
Apple
lie
Users
Handbook
than
or
equal
to
zero
and
less
than
one.
If
RN
D's
argument
(a)
is
positive, a
new
random
number
will
be generated each
time
RND
is
executed.
RND can also be used
with
a negative
argument.
The same
random
number
will
be
returned
when
RND
is
executed
with
the
same negative value
for
a.
If
the
same negative
argument
is
repeated
followed
by RND
statements
with
positive arguments,
the
same series
of
random
numbers
will
be generated. This
is
illustrated
in
the
following
example.
Example
100
PRINT RND (-1)
200
PRINT RND
(3)
300
PRINT RND (.22)
400
PRINT RND
(.33)
500
PRINT RND (-1)
600
PRINT
RND
(.99)
700
PRINT
RND
(2.7)
800
PRINT
RND
(.77)
]RUN [Ret]
2.991~6472E-08
.738107502
.272707136
.299733446
2.
99196472E-08
.738207502
.272707136
.299733446
In
Applesoft
BASIC,
if
a=
0,
RND
will
return
the
most
recently
generated
random
number.
In
Integer
BASIC, RND
returns
a
random
integer
with
a value
greater than
or
equal
to
zero
but
less
than
a.

Other manuals for Apple IIe

Related product manuals