abs---integer absolute value (magnitude)
#include <stdlib.h> int abs(int i);
the absolute value of i (also called the magnitude
of i). That is, if i is negative, the result is the opposite
of i, but if i is nonnegative the result is i.
The similar function
labs uses and returns
long rather than
The result is a nonnegative integer.
abs is ANSI.
No supporting OS subroutines are required.
Go to the first, previous, next, last section, table of contents.