Radio Shack TRS-80 User Manual page 222

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

Sign
Computes:
SGN(X),
the
sign-component
of
X
Output:
To
equal
to
1 for
X
negative,
for
X
zero,
Ifllll
+1
for
X
positive
Also
uses:
No
other
variables
Other
subroutines required
:
None
How
to
call:
GOSUB
30810
220
30000 END
30802 REM *SIGN* INPUT
X,
OUTPUT T=-t,0
OR
+1
30810
IF
X<0
T.
T=-l
30820
IF
X
=
T.
T=0
30830
IF
X>0
T.
T=l
30840
RET.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents