EasyManua.ls Logo

Commodore VIC-20 - Page 388

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...
374
The
VIC
20
User
Guide
FRE
can be used anywhere a function may appear, but it
is
normally
used in
an
immediate mode
PRINT
statement.
Example:
?FRE(1)
INT
Institute garbage collection and print the
number
of
free bytes
INT returns the integer portion of a number, rounding to the next lower
signed number.
Format:
INT(arg n)
For
positive numbers, INT
is
equivalent to dropping the fractional
portion
of
the number without rounding.
For
negative numbers, INT is
equivalent to dropping the fractional portion of the number and adding
1.
Note
that
INT does
not
convert a floating point number
(5
bytes)
to
integer
type
(2
bytes).
Example:
A-INT(I.5)
A·INT(-1.5)
XIII
I
NT(
-0.1)
Results in
A=
1
Results in
A=-2
Results in
X=-l
A caution here: Since floating point numbers are only close approxima-
tions
of
real numbers,
an
argument may not yield the exact INT function
value you might expect.
For
instance, consider the number 3.89999999. The
function *INT(3.89999999) would yield a 3 answer, not 4 as would be
expected.
IIFT$
?INT(3.S9999999)
3
LEFT$ returns the leftmost characters
of
a string.

Other manuals for Commodore VIC-20

Related product manuals