Commodore PET User Manual page 85

Table of Contents

Advertisement

CHR$
ASC
LEN
LOG
Returns the natural logarithm of the argument.
RND
Generates a random number. There are some rules regarding use
of RND; they are described in Chapter 4.
SIN
Returns the trigonometric sine of the argument. which is treated
as a radian quantity.
COS
Returns the trigonometric cosine of the argument. which is
treated as a radian quantity.
TAN
Returns the trigonometric tangent of the argument. which is
treated as a radian quantity.
ATN
Returns the trigonometric arctangent of the argument. which is
treated as a radian quantity.
Arithmetic functions perform commonly needed arithmetic operations on a
single argument. Here are some examples:
INT(A)
Returns the integer value of A.
SQR(144)
Returns the square root of 144 (j.e.. 12).
SIN(BX(1.0)) Returns the sine of array element BX(1.0).
The following functions constitute the string function group:
STR$
Converts a number ta its equivalent string of text characters.
VAL
Converts a string of text characters to their equivalent number (if
su ch a conversion is possible).
Converts an 8-bit binary code to its equivalent ASCII character.
Converts an ASCII character ta its 8-bit binary equivalent.
Returns the number of characters contained in the text string
identified by the argument.
LEFT$
Extracts the left part of a text string. Function arguments identify
the string and its left part.
RIGHT$ Extracts the right part of a text string. Function arguments iden-
tify the string and its right part.
MID$
Extracts the middle section of a text string. Function arguments
identify the string and the required mid part.
String functions let vou determine the length of a string. extract portions of
a string. and convert between numeric. ASCII. and string characters. These func-
tions take one. two. or three arguments. Here are some examples:
STR$(14)
Converts 14 to "14".
LEN("ABC"l Returns the length of the string. 3 is returned since the
string has three characters.
72

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents