PICO-8 Wiki
Advertisement
sgn( [number] )
Returns the sign of a number, 1 for positive, -1 for negative
number
The number to determine the sign of.

Examples

sgn(100) -- returns 1
sgn(0)   -- returns 1 (not 0)
sgn(-14) -- returns -1

Technical Note

sgn(0) will return 1

See also

Advertisement