This is an old version, view current version.

2.2 Absolute functions

T abs(T x)
The absolute value of x.

This function works elementwise over containers such as vectors. Given a type T which is int, or an array of ints, abs returns the same type where each element has had its absolute value taken.
Available since 2.0, vectorized in 2.30

int int_step(int x)

int int_step(real x)
Return the step function of x as an integer, int_step(x)={1if x>00if x0 or x is NaN Warning: int_step(0) and int_step(NaN) return 0 whereas step(0) and step(NaN) return 1.

See the warning in section step functions about the dangers of step functions applied to anything other than data.
Available since 2.0