
7-6
Section
Details of BASIC Commands
219
sgn
Syntax:
SGN
(<numerical expression>)
Description:
Function. Returns the sign of a numerical expression.
Remarks:
<numerical expression> may be any integer, single-precision floating point or double-precision
floating point.
SGN
returns 1 if the numerical expression is positive and -1 if the numerical expression is
negative. If the numerical expression is zero
SGN
returns 0.
Examples:
> 10 INPUT A%
> 20 IF SGN(A%) = 1 THEN PRINT "POSITIVE"
> 30 IF SGN(A%) = -1 THEN PRINT "NEGATIVE"
> 40 IF SGN(A%) = 0 THEN PRINT "ZERO"
> 50 GOTO 10
> RUN
? 1 <CR>
POSITIVE
? -34 <CR>
NEGATIVE
? 0 <CR>
ZERO
See also:
sin
Syntax:
SIN
(<numerical expression>)
Description:
Function. Calculates the sine of a numerical expression.
<numerical expression> may be any integer, single-precision floating point or double-precision
floating point.
The return type is single-precision floating point if the argument is of type integer or single-
precision floating point. If the argument is of type double-precision floating point then the return
type is also double-precision floating point.
Remarks:
Note:
1.
The argument should be specified in radians.
Examples:
> 10 A = 0.4
> 20 PRINT SIN(A)
> RUN
.389418
See also:
COS
,
TAN
space$
Syntax:
SPACE
$ (<numerical expression>)
Description:
Function. Returns a character string containing the specified number of spaces.
Remarks:
<numerical expression> may be any integer expression with a valid range: [0…255]. Non-integer
expressions will be rounded.
If the numerical expression is 0 then a null string is returned.
Examples:
> 10 A$ = “HELLO” + SPACE$(5) + “WORLD”
> 20 PRINT A$
> RUN
HELLO
WORLD
See also:
SPC
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...