ABS(3) BSD ABS(3)
NAME
abs, labs - integer, long integer absolute value
SYNOPSIS
#include <stdlib.h>
int abs(i)
int i;
long int labs (j)
long int j;
DESCRIPTION
abs and labs return the absolute values of their operands.
SEE ALSO
floor(3M) for fabs.
BUGS
Applying the abs (or labs) function to the most negative integer (or long
integer) generates a result that is the most negative integer (or long
integer). That is, abs(0x80000000) (or labs(0x80000000)) returns
0x80000000 as a result.