BASIC-SO

Functions

SGN

The SON function returns the sign of the specified expression. If the expression is greater than 0, SON returns 1. If the expression is 0, SON returns a 0. If the expres- sion is less than 0, SON returns -1.

SGN(expression)

10 INPUT A

20LET B = 3.14159*SGN(A)

30PRINT B

40END

RUN ? 44 3.14159 OK RUN ? -12

-3.14159

OK RUN

?O

o

Ok

SIN

The SIN function returns the sine value of the argument. The input is given in radians. The calculation is performed in single precision.

SIN (expression)

10 INPUT A

20PRINT SIN(A)

30END

RUN

?8

.989358 Ok

SPACES

The SPACE$ function returns a string of spaces equal to the value of the integer expression.

NOTE

SPACE$ returns an actual string.

SPACE$ (integer expression)

10 A =1

20PRINT "QUESTION";A;SPACE$(10);"THEORY"

30PRINT

40PRINT SPACE$(21);"TEXT"

50END

RUN

QUESTION 1 THEORY

TEXT

7-11

Page 75
Image 75
Intel 9800758-02 manual Sgn, Sin, Spaces, 10 a =1