.\"
.TH abs 3 (date) "Linux man-pages (unreleased)"
.SH NAME
-abs, labs, llabs, imaxabs \- compute the absolute value of an integer
+abs, labs, llabs, imaxabs, uabs, ulabs, ullabs, uimaxabs \- compute the absolute value of an integer
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
.BI "long labs(long " j );
.BI "long long llabs(long long " j );
.P
+.BI "unsigned int uabs(int " j );
+.BI "unsigned long ulabs(long " j );
+.BI "unsigned long long ullabs(long long " j );
+.P
.B #include <inttypes.h>
.P
.BI "intmax_t imaxabs(intmax_t " j );
+.BI "uintmax_t uimaxabs(intmax_t " j );
.fi
.P
.RS -4
.nf
_ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
.fi
+.P
+.BR uabs (),
+.BR ulabs (),
+.BR ullabs (),
+.BR uimaxabs ():
+.nf
+ _ISOC2Y_SOURCE
+.fi
.SH DESCRIPTION
The
-.BR abs ()
-function computes the absolute value of the integer
-argument
-.IR j .
-The
+.BR abs (),
.BR labs (),
.BR llabs (),
+.BR imaxabs (),
+.BR uabs (),
+.BR ulabs (),
+.BR \%ullabs (),
and
-.BR imaxabs ()
+.BR \%uimaxabs ()
functions compute the absolute value of the argument
.I j
of the
.BR abs (),
.BR labs (),
.BR llabs (),
-.BR imaxabs ()
+.BR imaxabs (),
+.BR uabs (),
+.BR ulabs (),
+.BR \%ullabs (),
+.BR \%uimaxabs ()
T} Thread safety MT-Safe
.TE
.SH STANDARDS
-C11, POSIX.1-2008.
+C2Y.
.SH HISTORY
POSIX.1-2001, C99, SVr4, 4.3BSD.
.\" POSIX.1 (1996 edition) requires only the
and
.BR imaxabs ()
were added in C99.
+The functions
+.BR uabs (),
+.BR ulabs (),
+.BR \%ullabs (),
+and
+.BR \%uimaxabs ()
+were added in C2Y.
.SH NOTES
-Trying to take the absolute value of the most negative integer
+For
+.BR abs (),
+.BR labs (),
+.BR llabs (),
+and
+.BR imaxabs ()
+trying to take the absolute value of the most negative integer
is not defined.
.P
The
The
.BR imaxabs ()
function is included since glibc 2.1.1.
+The
+.BR uabs (),
+.BR ulabs (),
+.BR \%ullabs (),
+and
+.BR \%uimaxabs ()
+functions are included since glibc 2.42.
.P
For
.BR llabs ()
.BR llabs ()
and
.BR imaxabs ()
+and (since GCC 15.0)
+.BR uabs (),
+.BR ulabs (),
+.BR \%ullabs (),
+and
+.BR \%uimaxabs ()
as built-in functions.
.SH SEE ALSO
.BR cabs (3),