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 - Absolute value of an integer (long int)

&pagelevel(4)&pagelevel

Definition

#include <stdlib.h>

long int labs(long int j);

labs calculates the absolute value of an integer j of type long int.

Return val.

|j|

undefined

for an integer j.

in case of over- or underflow. errno is set to ERANGE to indicate the error.

Note

The absolute value of the highest presentable negative number cannot be presented. If the
highest negative number of type long int is specified as argument j, the program is terminated
with an error (ERANGE).

See also

abs, cabs, fabs, llabs