Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

abs - return integer absolute value

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

int abs(int i);

Description

abs() computes the absolute value of an integer i.

Return val.

Notes

Absolute value of i if successful.

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 i, the
program will terminate with an error.

See also

cabs(), fabs(), labs(), stdlib.h.