Name

llabs - computes the absolute value of an integer

Library

libc.lib

Synopsis

  #include <stdlib.h>
  long long llabs (long long j);

Return values

The llabs function returns the absolue value.

Detailed description

The llabs function returns the absolute value of j.


Examples

#include  <stdio.h>
#include  <stdlib.h>
 
int main( void )
{
   int    ix = -4, iy;
   long   lx = -41567L, ly;
   long long llx = -5343546758, lly;
 
   iy = abs( ix );
   printf( "The abs value of %d is %d\n", ix, iy);
 
   ly = labs( lx );
   printf( "The abs value of %ld is %ld\n", lx, ly);
 
   lly = llabs( llx );
   printf( "The abs value of %lld is %lld\n", llx, lly );
 
   return 0;
}

         

Output

The absolute value of -4 is 4
The absolute value of -41567 is 41567
The absolute value of -5343546758 is 5343546758

         

Errors

No errors are defined.

See also

abs, fabs, hypot, labs, math

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top