Sgn; Sin - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

SGN
S G N ( <numeric expression> )
10 FOR n=200 TO -200 STEP-20
20 PRINT "SGN returns";
30 PRINT SGN(n);"for a vaLue of";n
40 NEXT
run
FUNCTION: Determines the SiG N of the <numeric expression>. S G N returns -1 if
<numeric expression> is less than zero, returns 0 if <numeric expression> equals zero,
and returns 1 if <numeric expression> is greater than zero.
Associated keywords: AB S
SIN
SIN ( <numeric expression> )
10 CLS:DEG:ORIGIN 0,200
20 FOR n=0 TO 720
30 y=SIN(n)
40 PLOT
n*64~/720,198*y:NEXT
50 GOTO 50
run
FUNCTION: Calculates the S I Ne ofthe <numeric expression>.
Note that D E G and RA D can be used to force the result of the above calculation to
degrees or radians respectively.
Associated keywords: AT N, COS,
DE
G, RA
D,
TAN
Chapter 3 Page 72
Complete List of Keywords

Advertisement

Table of Contents
loading

Table of Contents

Save PDF