Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2017
 
 

labs(3C)

Name

abs, labs, llabs - return absolute value of integer

Synopsis

#include <stdlib.h>

int abs(int val);
long labs(long lval);
long long llabs(long long llval);

Description

The abs() function returns the absolute value of its int operand.

The labs() function returns the absolute value of its long operand.

The llabs() function returns the absolute value of its long long operand.

Usage

In 2's-complement representation, the absolute value of the largest magnitude negative integral value is undefined.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe
Standard

See Also

attributes(5), standards(5)