ABS(3P)
π ABS(3P) β bestie edition π
okay so welcome to the POSIX Programmer's Manual, the abs page, and honestly? it's a short one. a little snack. a lil' bite-sized baddie. but we're still gonna do it right. no skipping. let's go π«Ά
β¨ PROLOG
heads up, bestie: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so consult the corresponding Linux manual page for details on Linux behavior β or, plot twist, the interface may not be implemented on Linux at all. π
πΈ NAME
abs β return an integer absolute value. that's it. that's the whole job. iconic behavior honestly β¨
π SYNOPSIS
#include <stdlib.h>
int abs(int i);
look at her. so clean. so simple. main character energy π¦
π DESCRIPTION
so, the functionality described on this reference page is aligned with the ISO C standard. And like β if there's any conflict between what's written here and the ISO C standard? that conflict is unintentional, fr fr. This volume of POSIX.1β2017 defers to the ISO C standard. respect the hierarchy, periodt. π
The abs() function shall compute the absolute value of its integer operand, i. π
okay but listen β if the result cannot be represented, the behavior is undefined. undefined behavior is NOT cute, bestie. it's giving chaos. do not do this to yourself. π
β RETURN VALUE
The abs() function shall return the absolute value of its integer operand. like, that's the whole vibe check. in goes i, out comes the abs. π
π ERRORS
No errors are defined. she simply does not have problems. mentally stable queen. β¨
The following sections are informative β i.e. the vibes-only section, not the requirements section. iykyk.
π EXAMPLES
None. π
(sorry bestie. no examples. she's a minimalist. we respect it. π«Ά)
π§ APPLICATION USAGE
okay this one matters, so lean in π
In two's-complement representation, the absolute value of the negative integer with the largest magnitude, {INT_MIN}, might not be representable. π
so like β that one specific value is out here living its truth and abs() literally cannot return it. be careful with that one. that's the drama. that's the whole drama. π
π RATIONALE
None. π
(nothing to justify. she just is. iconic.)
π¦ FUTURE DIRECTIONS
None. β
(future? she's timeless.)
π₯ SEE ALSO
fabs()labs()- The Base Definitions volume of POSIX.1β2017,
<stdlib.h>
go read those too, bestie, they're in the same friend group π«Ά
π COPYRIGHT
okay legal time, stay with me, this is the realest part:
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, babes π IEEE/The Open Group, 2017 β the source and the version and the date, all in one lil' sign-off. ABS(3P) out. slay, stay safe, and don't you DARE call abs() on INT_MIN πβ¨π¦
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms