Name
labs - Converts to absolute value.
Syntax
#include <stdlib.h>
long labs(n)
long n;
Description
The labs function produces the absolute value of its long-
integer argument n.
Return Value
The labs function returns the absolute value of its
argument. There is no error return.
See Also
abs(S), cabs(DOS), fabs(S)
Example
#include <stdlib.h> #include <stdio.h>
main()
{
long x,y;
x = -41567L;
y = labs(x);
printf("The labs(%ld) = %ld",x,y);
}
This program uses labs to get and display the absolute value
of -41,567.
(printed 6/18/89)