CABS(3P)

πŸ’– CABS(3P) β€” the complex absolute value glow-up πŸ’–

okay bestie, so this is cabs, cabsf, cabsl β€” yes those are three whole functions, it's a family thing β€” and they all live in the POSIX Programmer's Manual. 🫢


🌸 PROLOG 🌸

so like, first things first, this manual page is part of the POSIX Programmer's Manual. but heads up, bestie: the Linux implementation of this interface may differ (if you're on Linux, go read the corresponding Linux manual page for the deets on how Linux actually behaves, iykyk). orrrr it's possible the interface isn't implemented on Linux at all. πŸ’€ so don't come for me if it's not there.


✨ NAME ✨

cabs, cabsf, cabsl β€” return a complex absolute value. that's it. that's the whole job. slay. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <complex.h>

double cabs(double complex z);
float cabsf(float complex z);
long double cabsl(long double complex z);

three functions, three vibes, one purpose. the f one is the float girlie, the l one is the long double queen, and plain cabs is your standard double main character. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the functionality described on this reference page is aligned with the ISO C standard. and if there's any conflict between what's written here and what the ISO C standard says? that conflict is unintentional, fr fr, nobody meant it. this volume of POSIX.1‐2017 defers to the ISO C standard, periodt. so the ISO C standard is the authority here, not this page. 😌

and now the actual tea: these functions shall compute the complex absolute value of z. and because one name is never enough for something this iconic, that's also called the norm, the modulus, or the magnitude. same thing, three nicknames, we love a versatile icon. 🌈


πŸ’œ RETURN VALUE πŸ’œ

these functions shall return the complex absolute value. that's the whole return value section. no plot twist. πŸŽ€


🌟 ERRORS 🌟

no errors are defined. not a single one. she simply does not fail. πŸ’…

and just so you know, the following sections are informative β€” meaning they're the lil bonus content, not the hard requirements. πŸ“–


πŸ™ˆ EXAMPLES πŸ™ˆ

None.

like, literally none. nothing to see here bestie, move along. 😭


πŸ“ APPLICATION USAGE πŸ“

None.


🧚 RATIONALE 🧚

None.


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • The Base Definitions volume of POSIX.1‐2017, <complex.h> β€” go read that one, it's the source material. πŸ’–

okay this part is long but we do NOT skip it, bestie, legal girlies are valid:

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 .

fr fr, if you spot a typo, it's probably from the source-file-to-manpage conversion glow-down, not the actual standard. report it at that link above. 🫢

and that's the whole page, bestie!! πŸŽ‰ this one came to you from IEEE/The Open Group, 2017 β€” CABS(3P), iconic, timeless, modulus-coded. go compute some absolute values and eat. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from