Google
 

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

long int labs(x)
long int x;
{
	return (x < 0) ? -x : x;
}