abs Function (Macro)

math.h, stdlib.h, timath.h

any_type abs (any_type x);

Absolute value of a number.

abs returns the absolute value of a numeric argument x, which may be either an integer or a floating point value. The returned value is of the same type as the argument.

Note: abs is a smart macro compiling to open code which depends on the type of the argument.


See also: labs, fabs