From: Anton Zellerhoff Date: Sun, 13 Apr 2025 17:50:11 +0000 (+0200) Subject: man/man3/abs.3: Document u{,l,ll,imax}abs() X-Git-Tag: man-pages-6.14~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=deca8968032f26f1e511dfe46625b064f56305de;p=thirdparty%2Fman-pages.git man/man3/abs.3: Document u{,l,ll,imax}abs() C2Y adds unsigned versions of the abs functions (see C2Y draft N3467 and proposal N3349). Support for these functions will be included in GCC 15 and glibc 2.42. Link: Link: Link: Link: Signed-off-by: Anton Zellerhoff Message-ID: <28a36070fe18707ab9fa26b91c88e6fd87a72097.1744566285.git.wg14@ascz.de> Signed-off-by: Alejandro Colomar --- diff --git a/man/man3/abs.3 b/man/man3/abs.3 index 6a9780019..fbd546cdf 100644 --- a/man/man3/abs.3 +++ b/man/man3/abs.3 @@ -14,7 +14,7 @@ .\" .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 ) @@ -26,9 +26,14 @@ Standard C library .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 .P .BI "intmax_t imaxabs(intmax_t " j ); +.BI "uintmax_t uimaxabs(intmax_t " j ); .fi .P .RS -4 @@ -40,17 +45,25 @@ Feature Test Macro Requirements for glibc (see .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 @@ -72,11 +85,15 @@ T{ .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 @@ -93,8 +110,21 @@ functions; the functions 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 @@ -103,6 +133,13 @@ function is included since glibc 2.0. 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 () @@ -121,6 +158,12 @@ and (since GCC 3.0) .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), diff --git a/man/man3/uabs.3 b/man/man3/uabs.3 new file mode 100644 index 000000000..97db8d2b6 --- /dev/null +++ b/man/man3/uabs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/man/man3/uimaxabs.3 b/man/man3/uimaxabs.3 new file mode 100644 index 000000000..97db8d2b6 --- /dev/null +++ b/man/man3/uimaxabs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/man/man3/ulabs.3 b/man/man3/ulabs.3 new file mode 100644 index 000000000..97db8d2b6 --- /dev/null +++ b/man/man3/ulabs.3 @@ -0,0 +1 @@ +.so man3/abs.3 diff --git a/man/man3/ullabs.3 b/man/man3/ullabs.3 new file mode 100644 index 000000000..97db8d2b6 --- /dev/null +++ b/man/man3/ullabs.3 @@ -0,0 +1 @@ +.so man3/abs.3