FANDOM


V1Edit

Indications are, SGN in SmileBasic V1 is identical to that in V2.

V2Edit

SGN is a function which takes one numerical parameter, and returns the 'sign' of the number.

If the parameter is zero, SGN returns zero. If the parameter is positive, then SGN returns 1, and if the parameter is negative, SGN returns -1. As such, when the parameter is nonzero, SGN(X) evaluates to the same as X/ABS(X)... except when X is the 'buggy' value -0.

If the parameter is missing, the system produces Syntax error (SGN), if the parameter is a string, the system givs a Type Mismatch (SGN) error, and if two or more parameters are passed, the system gives the misleading Missing operand (SGN) error.

V3Edit

Indications are, SGN in SmileBasic V3 is identical to that in V2, except hopefully, the "-0" bug is fixed.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.