EasyManua.ls Logo

Commodore VIC-20 - Page 126

Commodore VIC-20
404 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...
112
The
VIC
20
User
Guide
arguments
D$
and 2 are enclosed in parentheses. Generally stated, any
function
will
have one of the following two formats:
r-r
-------
Single argument for a function
+ that has just one argument
function (argl)
T
'U":
(T-La_rg_2_)
_____
Two arguments for a function
_ that needs two arguments
Letters that specify the function
A
few
functions need three arguments. Each function argument can
be
a
constant, a variable,
or
an expression.
A function appearing in a BASIC statement
is
evaluated before any
operators. Every function in a BASIC statement is reduced to a single
numeric or string value before any other part of the BASIC statement
is
evaluated. For example, in the following statement the
SQR
and SIN
functions are evaluated first:
10
B=24.7'(SQR(C)+5)-SIN(0.2+D)
Suppose SQR(C) = 6.72 and SIN(0.2 + D) = 0.625. The statement
on line
10
will
first
be
reduced to
10
B=24.
7*(6. 72+5)-0.
625
This simpler statement
is
then evaluated.
Arithmetic
Functions
Here
is
a list of the arithmetic functions that can be used with VIC
BASIC.
INT Converts a floating point argument to its integer
equivalent by truncation.
SGN Returns the sign
of
an argument: + I for a positive
argument,
-I
for a negative argument, 0 for 0
argument.
ABS
Returns the absolute value
of
an argument. A
positive argument does not change; a negative
argument
is
converted to its positive equivalent.
SQR Computes the square root of the argument.

Other manuals for Commodore VIC-20

Related product manuals