31
REM
Purpose To insert explanatory remarks in a program.
Syntax REM remark
‘ remark
Remarks “remark” may be any sequence of characters.
The BASIC compiler will ignore whatever follows REM or the apostrophe (‘)
end of the line.
Example
SET_PRECISION
Purpose To set the precision of the decimal points for printing real number expressions.
Syntax SET_PRECISION(N%)
Remarks “N%” is a numeric expression in the range of 0 to 6.
The precision is set to two digits by default.
Example
PI! = 3.14159
PRINT “PI = ”, PI!
SET_PRECISION(6)
PRINT “PI = ”, PI!
SET_PRECISION(2)
‘ result: PI = 3.14 (by default)
‘ result: PI = 3.141590
SGN
Purpose To return an indication of the mathematical sign (+ or -
expression.
Syntax A% = SGN(N)
Remarks “A%” is an integer variable to be assigned to the result.
1
0
-1
N > 0
N = 0
N < 0
“N” is a numeric expression.
Example
A% = SGN(100)
‘ A% = 1