Trailing-Edge
-
PDP-10 Archives
-
SRI_NIC_PERM_FS_1_19910112
-
kcc-5/lib/math/abs.c
There are 7 other files named abs.c in the archive. Click here to see a list.
/*
* ABS.C - integer absolute value for math library
*
* This code conforms with the description of the abs function
* as defined in Harbison and Steele's "C: A Reference Manual",
* section 11.3.1
*
* This is implemented as a function instead of a macro like
*
* #define abs(x) ((x) < 0) ? -(x) : (x))
*
* because of the side-effect difference in a case like abs(n++)
*/
int abs(x)
int x;
{
return (x < 0) ? -x : x;
}