abs.3c (2010 09)

a
abs(3C) abs(3C)
NAME
abs( ), labs( ), llabs( ), imaxabs( ) - return integer absolute value
SYNOPSIS
#include <stdlib.h>
int abs(int i);
long int labs(long int i);
long long llabs(long long i);
#include <inttypes.h>
intmax_t imaxabs(intmax_t i);
DESCRIPTION
abs() computes the absolute value of its integer operand.
labs() computes the absolute value of its long integer operand.
llabs() computes the absolute value of its long long integer operand.
imaxabs() computes the absolute value of its intmax_t integer operand.
If the result value can not be represented, the behavior of these functions is undefined.
RETURN VALUE
abs() returns the absolute value of its integer operand.
labs() returns the absolute value of the long integer operand.
llabs() returns the absolute value of the long long integer operand.
imaxabs() returns the absolute value of the intmax_t integer operand.
The largest negative integer returns itself.
WARNINGS
In twos-complement representation, the absolute value of the negative integer with the largest magnitude
can not be represented.
SEE ALSO
imaxdiv(3C), floor(3M), thread_safety(5).
STANDARDS CONFORMANCE
abs(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
labs(): AES, SVID3, XPG4, ANSI C
llabs(): ISO/IEC 9899:1999 (C99), UNIX 03
imaxabs(): ISO/IEC 9899:1999 (C99), UNIX 03
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)