sign(int x): int

sign(var x): var

The sign of x: -1, 0, or 1.

Parameters:

x - any var or int.

Returns:

x > 0 1
x == 0 0
x < 0 -1

Example:

 

See also:

sqrt, abs, cdf

► latest version online