Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

labs - return long integer absolute value

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

long int labs(long int j);

Description

labs() computes the absolute value of an integer j of type long.

Return val.

Absolute value of the long integer j if successful.

Notes

The absolute value of the negative integer with the largest magnitude is not representable.
If a negative number with the highest magnitude (-231) is specified as the argument j, the
program will terminate with an error.

See also

abs(), cabs(), stdlib.h.