CHAPTER 7

FUNCTIONS

ABS

The ABS function returns the absolute value of the specified expression. The absolute value of an expression is its numeric value with a positive sign.

ABS(expression)

10 INPUT A

20A = ABS(A *2)

30PRINT A

40END

RUN ?5

Ok

RUN

?-5

10 Ok

Ase

The ASC function returns the ASCII code of the first character of the specified string.

ASC(string expression)

PRINT ASC ("0"), ASC("AB")

48 65

ATN

The ATN function returns the arctangent value of the specified expression. The result, given in radians, is between -PI/2 and PI/2. The calculation is performed in single precision, but the argument may be any numeric type.

ATN(expression)

10INPUT A

20B = ATN(A)

30PRINT B

40END

RUN ?5 1.373401 Ok

7-1

Page 65
Image 65
Intel 9800758-02 manual Abs, Atn