beautypg.com

Remote Processing CAMBASIC User Manual

Page 148

background image

Comm ands - 115

SGN

Numeric Fun ction

SYNTAX:

n = S G N (m)

PURPOSE:

Determines if number is positive or negative.

REMARK S:

m i s a n y n u mb e r. S G N r et ur n s t he fo ll ow i ng :

n = 0, m is 0
n = 1, m is positive
n = -1, m is negative

RELATED:

none

EXAMPLE:

10 A = 15
20 PRINT SGN(A)

RUN

1

ERROR:

none