Commodore 64 User Manual page 137

Hide thumbs Also See for 64:
Table of Contents

Advertisement

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 (1)*(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 -I 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 0. If X is negative , an ILLEGAL QUANTITY ERROR 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

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents