]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/abs.3: Document u{,l,ll,imax}abs()
authorAnton Zellerhoff <wg14@ascz.de>
Sun, 13 Apr 2025 17:50:11 +0000 (19:50 +0200)
committerAlejandro Colomar <alx@kernel.org>
Mon, 14 Apr 2025 07:45:52 +0000 (09:45 +0200)
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: <https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3467.pdf>
Link: <https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3349.pdf>
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117024>
Link: <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=5b132ec2b7712dbc055838b3b538b83ad1196414>
Signed-off-by: Anton Zellerhoff <wg14@ascz.de>
Message-ID: <28a36070fe18707ab9fa26b91c88e6fd87a72097.1744566285.git.wg14@ascz.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/abs.3
man/man3/uabs.3 [new file with mode: 0644]
man/man3/uimaxabs.3 [new file with mode: 0644]
man/man3/ulabs.3 [new file with mode: 0644]
man/man3/ullabs.3 [new file with mode: 0644]

index 6a9780019311374511f94a04731acd4c73a278a1..fbd546cdf19be36d44b171a438ffe9d81480cc90 100644 (file)
@@ -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 <inttypes.h>
 .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 (file)
index 0000000..97db8d2
--- /dev/null
@@ -0,0 +1 @@
+.so man3/abs.3
diff --git a/man/man3/uimaxabs.3 b/man/man3/uimaxabs.3
new file mode 100644 (file)
index 0000000..97db8d2
--- /dev/null
@@ -0,0 +1 @@
+.so man3/abs.3
diff --git a/man/man3/ulabs.3 b/man/man3/ulabs.3
new file mode 100644 (file)
index 0000000..97db8d2
--- /dev/null
@@ -0,0 +1 @@
+.so man3/abs.3
diff --git a/man/man3/ullabs.3 b/man/man3/ullabs.3
new file mode 100644 (file)
index 0000000..97db8d2
--- /dev/null
@@ -0,0 +1 @@
+.so man3/abs.3