Name

labs

Synopsis

Gives the absolute value of a long integer

#include <stdlib.h>
longlabs( long n );

The parameter and the return value of labs() are long integers. Otherwise, labs() works the same as the int function abs().

Example

See the example for abs() in this chapter.

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.