labs() — Calculate long absolute value

Format

#include <stdlib.h>

long int labs(long int n);

General description

The labs() function calculates the absolute value of its long integer argument n. The result is undefined when the argument is equal to LONG_MIN, the smallest available long integer (-2 147 483 648). The value LONG_MIN is defined in the limits.h header file.

Returned value

The labs() function returns the absolute value of the long integer argument n.

Related Information