EasyManua.ls Logo

Commodore 64 - Page 133

Commodore 64
176 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 negative value for X will reseed the generator. The use of the same
negative number for X will result in the same sequence of "random"
numbers.
The formula for generating a number between X and Y is:
N = RND(l)*(Y-X)+X
where,
Y is the upper limit
X is the lower range of numbers desired.
SGN(X) (sign)
This function returns the sign (positive, negative, or zero) of X. The
result will be + 1 if positive, 0 if zero, and -1 if negative.
SIN(X) (sine)
SIN(X) is the trigonometric sine function. The result will be the sine of
X, where X is an angle in radians.
SQR(X) (square root)
This function will return the square root of X, where X is a positive
number or O. If X is negative, an IllEGAL QUANTITYERROR results.
TAN(X) (tangent)
The result will be the tangent of X, where X is an angle in radians.
USR(X)
When this function is used, the program jumps to a machine language
program whose starting point is contained in memory locations. The pa-
rameter X is passed to the machine language program, which will re-
turn another value back to the BASIC program. Refer to the Commodore
64 Programmer's Reference Manual for more details on this function
and machine language programming.
127

Table of Contents

Other manuals for Commodore 64

Related product manuals