Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C99 |
both | z/OS® V1R7 |
#define _ISOC99_SOURCE
#include <inttypes.h>
intmax_t imaxabs(intmax_t j);
The imaxabs() function computes the absolute value of j. When the input value is INTMAX_MIN, the value is undefined. The imaxabs() function is similar to llabs() and labs(). The only difference being that the return value and the argument passed in are of type intmax_t.
The imaxabs function returns the absolute value of j.
#define _ISOC99_SOURCE
#include <inttypes.h>
#include <stdio.h>
int main(void)
{
intmax_t a = -1234;
intmax_t b = imaxabs(a);
printf("%jd \n", b );
}
Output:
1234