SGN
n = SGN (x)
Sign of x
. Return values are +1
for
positive x
, -1
for negative x
and
0
for zero. SGN cannot accept a numeric string, such as
“24”, as an argument.
Example
PRINT SGN(2), SGN(-2), SGN(0) ' Output is: 1 -1 0
PRINT SGN(INT("-2")) ' Output is: -1
Code samples using SGN
bairstow.bas
bezier's autograph book.bas
bezierbounce.bas
checkers.bas
checkers.bas
chess.bas
chess.bas
coordplot.bas
dmsareaplot.bas
glitter hopalong.bas
glitter hopalong.bas
gputmalc.bas
guts.bas
hopalong copy.bas
hopalong.bas
hopalong.bas
lib-gputmcon.bas
moonup.bas
sunup.bas
svirjee_fractal_1.bas
tshot.bas
Math
ABS
ABSMAX
ABSMIN
ACOS
ACOSH
ACOT
ACOTH
ACSC
ACSCH
ASEC
ASECH
ASIN
ASINH
ATAN
ATAN2
ATANH
ATN
CEIL
COS
COSH
COT
COTH
CSC
CSCH
DEG
DERIV
DETERM
DIFFEQN
EXP
EXPRSEQ
FIX
FLOOR
FRAC
INT
INTERSECT
INVERSE
LINEQN
LOG
LOG10
M3APPLY
M3IDENT
M3ROTATE
M3SCALE
M3TRANS
MAX
MIN
POLYAREA
POLYCENT
POLYEXT
POW
PTDISTLN
PTDISTSEG
PTSIGN
RAD
RND
ROOT
ROUND
SEC
SECH
SEGCOS
SEGLEN
SEGSIN
SEQ
SGN
SIN
SINH
SQR
STATMEAN
STATMEANDEV
STATMEDIAN
STATSPREADP
STATSPREADS
STATSTD
SUM
SUMSQ
TAN
TANH
TRANSPOSE
If there is insufficient information on this page and you wish learn more about SGN,
please send an email to smallbasic@gmail.com. You can help to improve information about
SGN by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.