abs(int x): int

abs(var x): var

Absolute amount of x.

Parameters:

x - any var or int.

Returns:

x >= 0 then x
x < 0 then  -x

Example:

x = abs(2); // x is now 2
x = abs(-599); // x is now 599 
x = abs(0); // x is now 0 

See also:

 sign

► latest version online