![]() Chapter Contents |
![]() Previous |
![]() Next |
| llabs |
| Portability: | ISO/ANSI C conforming, UNIX compatible |
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| IMPLEMENTATION | |
| EXAMPLE | |
| RELATED FUNCTIONS | |
| SEE ALSO |
| SYNOPSIS |
#include <stdlib.h> long long int labs(long long int j);
| DESCRIPTION |
llabs
returns the absolute value of a
long long int
.
| RETURN VALUE |
llabs
returns the absolute value of its argument. Both the result and the argument
are of
long long int
type.
| IMPLEMENTATION |
llabs
is implemented as a macro that invokes the built-in
abs
function.
| EXAMPLE |
#include <stdio.h>
#include <stdlib.h>
main()
{
long long int a, c; /* The variable, a, can have a negative value. */
int b;
puts("Enter values for a (can be negative) and b:");
scanf("%ld %d", & a, & b);
c = llabs(a*b); /* Calculate absolute value. */
printf("The absolute value of their product = %ld\n", c ); }
}
| RELATED FUNCTIONS |
| SEE ALSO |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.