EasyManuals Logo

Atari 800 Basic Reference Manual

Atari 800
122 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 #42 background imageLoading...
Page #42 background image
LOG
RND
SGN
s~
Returns
the
greatest
integer
less
than
or
equal
to
the
value
of
the
expression.
This
is
true
whether
the
expression
evaluates
to a
positive
or
negative
number.
Thus,
in
our
first
example
above,
I
is
used
to
store
the
number
3.
In
the
second
example,
X is
used
to
store
the
number-
15
(the
first
whole
number
that
is
less
than
or
equal
to
-14.66778).
This
INT
function
should
not
be
confused
with
the
function
used
on
calculators
that
simply
truncates
(cuts
off)
all
decimal
places.
Format:
LOG(aexp)
Example:
100 L = LOG(67.89/2.57)
Returns
the
natural
logarithm
of
the
number
or
expression
in
parentheses.
LOG(O)
should
give
an
error
and
LOG(1)
should
be
0.
Format:
RND(aexp)
Example:
10
A=RND
(0)
Returns
a
hardware-generated
random
number
between
0
and
1,
but
never
returns
1.
The
variable
or
expression
in
parentheses
following
RND is a
dummy
and
has
no
effect
on
the
numbers
returned.
However,
the
dummy
variable
must
be
used.
Generally,
the
RND
function
is
used
in
combination
with
other
BASIC
statements
or
functions
to
return
a
number
for
games,
decision
making,
and
the
like.
Here's
a
simple
routine
that
returns
a
random
number
between
0
and
999.
1 0
:~~=~~NO(
0)
20
F.::x:=IHT<
1000:~~:;()
33
PRINT
R?i
Format:
SGN(aexp)
Example:
100 X = SGN(-199}
(0
is
dummy
variabl
e)
(-1
would
be returned)
Returns
a
-1
ifaexp
evaluates
to
a
neg
a
tive
numbe
r;
a 0
ifa
exp
evaluates
to 0,
or
a
1
if
aexp
evaluates
to a
positive
number.
Format:
SQR(aexp)
Example:
100 PRINT SQR(100) (10
would
be printed)
Returns
the
square
root
of
the
aexp
which
must
be
positive.
TRIGONOMETRIC
FUNCTIONS
ATN
Format:
ATN(aexp)
Example:
100 X = ATN(65)
Returns
the
arctangent
of
the
variable
or
expression
in
parentheses
.
cos
Format:
COS(
ae
xp)
Example:
100 C = COS(X+Y+Z)
Note:
Presumes
X,
Y,
Z
previously
defined
!
Returns
the
trigonometric
cosine
of
the
expre
ssion
in
parentheses.
34
F
un
ct
ion
Library

Table of Contents

Other manuals for Atari 800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari 800 and is the answer not in the manual?

Atari 800 Specifications

General IconGeneral
ProcessorMOS Technology 6502
Processor Speed1.79 MHz
ROM10 KB
GraphicsANTIC and GTIA chips
Release Year1979
Display Resolutionup to 320 x 192
Colors128 colors
Sound4 channels
StorageCartridge, cassette, floppy disk
PortsCartridge, serial, monitor
Operating SystemAtari OS

Related product manuals