labs3
Compute the absolute value of an integer
Part of abs(3).
Usage
#include <stdlib.h>
int abs(int j); long labs(long j); long long llabs(long long j);
unsigned int uabs(int j); unsigned long ulabs(long j); unsigned long long ullabs(long long j);
#include <inttypes.h>
intmax_t imaxabs(intmax_t j); uintmax_t umaxabs(intmax_t j);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
llabs():
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
uabs(), ulabs(), ullabs(), umaxabs():
_ISOC2Y_SOURCE
Library
Standard C library (libc, -lc)
Overview
These functions compute the absolute value of the argument j of the appropriate integer type for the function.
Return value
Returns the absolute value of the integer argument, of the appropriate integer type for the function.
Attributes
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| abs(), labs(), llabs(), imaxabs(), uabs(), ulabs(), ullabs(), umaxabs() | Thread safety | MT-Safe |
Releases
19 releases since Debian 1.1 (Buzz); the text changed 13 times.