labs
long labs ( long n ); | stdlib.h |
cplusplus.com |
Return absolute value of long integer parameter.
The absolute value corresponding to the long int parameter n is returned
( /n/ ).
Parameters.
Return Value.
The absolute value of n.
Portability.
Defined in ANSI-C.
Example.
/* labs example */
#include <stdio.h>
#include <stdlib.h>
main ()
{
int n,m;
n=labs(65537);
m=labs(-100000);
printf ("n=%d\n",n);
printf ("m=%d\n",m);
return 0;
}
Output:
n=65537
m=100000