EasyManua.ls Logo

Commodore PET - Log

Commodore PET
447 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...
A caution here: since floating
point
numbers are only close approximations
of real numbers. an
argument
may
not
yield the exact INT
function
value vou
might
expect. For instance. consider a simple loop going from 2
to
4 by suc-
cessively adding one-tenth
1.1).
FOR
1=2
TO
4
STEP.1:?I:NEXT
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.49999999
3.59999999
3.69999999
3.79999999
3.89999999
3.99999999
READ'r'.
You
will
see
that
the six numbers 3.5 through 4 are represented only ap-
proximately. If these values were in an array
A(O)
through A(20). the
function
INT(A(20))
would
equal
3.
not
4
as
would
be
expected.
LOG
LOG
returns the
naturallogarithm.
or log
to
the base
e.
The value of e used
is
2.71828183.
Format:
LOG(arg)
where:
arg
tive.
152
is
a positive. non-zero number. variable. or ex-
pression.
An Illegal Quantity error message
is
issued if the argument
is
zero or nega-

Table of Contents

Related product manuals