Format
#include <stdlib.h> long long int llabs(long long int n);
Language Level: Extension
llabs produces the absolute value of its long long
integer argument n.
The result may be undefined when the argument is equal to
LONGLONG_MIN, the smallest available long long integer
(-9 223 372 036 854 775 808). The
value LONGLONG_MIN is defined in the <limits.h> include
file.
Return Value
llabs returns the absolute value of n. There is no error
return value.
Example
This example computes y as the
absolute value of the long long integer -415672342.
#include <stdlib.h> #include <stdio.h>
int main(void)
{
long long x, y;
x = -415672342L;
y = llabs(x);
printf("The absolute value of %lld is %lld\n", x, y);
return 0;
/****************************************************
The output should be:
The absolute value of -415672342 is 415672342 ****************************************************/ }
![]()
abs -- Calculate Integer
Absolute Value
fabs -- Calculate
Floating-Point Absolute Value
labs -- Calculate
Absolute Value of Long Integer
<limits.h>