CREAL(3POSIX)
π CREAL(3POSIX) β the complex real functions π
okay bestie, welcome to the POSIX Programmer's Manual, page CREAL(3POSIX). yes we're doing C math today and yes it's gonna be cute. sit down, grab a strawberry π, we're getting the real part out of a complex number and it's lowkey the easiest thing you'll do all day.
β¨ PROLOG
so like, a little heads up first, no cap:
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
translation: this is the POSIX version of the story, your Linux box might tell it a lil differently, and it might not even be implemented on Linux at all. check your local manpage, iykyk. π«Ά
πΈ NAME
creal, crealf, creall β complex real functions
it's giving "extract the real part, that's the whole job." iconic honestly.
π SYNOPSIS
#include <complex.h>
double creal(double complex z);
float crealf(float complex z);
long double creall(long double complex z);
three flavours, one vibe: double, float, long double. pick your size bestie π
π¦ DESCRIPTION
okay so first things first, the boring-but-important part:
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1β2017 defers to the ISO C standard.
basically if this page and the ISO C standard ever beef, ISO C wins. not me making the rules, that's just how it is π
and now the actual tea:
These functions shall compute the real part of z.
that's it. that's the function. you hand it a complex number, it hands you back the real half. main character energy, zero drama. β¨
π RETURN VALUE
These functions shall return the real part value.
like, the actual number. the real one. slay. π
π ERRORS
No errors are defined.
not a single one. it literally cannot fail at this. we love a low-maintenance function fr fr.
The following sections are informative.
(so everything from here down is like, extra context, not requirements. noted bestie π)
π EXAMPLES
None.
yeah they left us on read for this one π no example, no problem, we move.
π§ APPLICATION USAGE
here's the one little gem they DID give us β for a variable z of type complex:
z == creal(z) + cimag(z)*I
so your complex number is literally just its real part plus its imaginary part times I. put that in your notes app and highlight it, it's that kind of fact. π₯
β RATIONALE
None.
no rationale, no explanation, no lore. the function simply is. mysterious. ethereal. we stan a quiet queen. π
π° FUTURE DIRECTIONS
None.
the future holds... nothing for this function. it's perfect as-is and it knows it. periodt. π
π SEE ALSO
go give these besties a visit, they're all in the complex-number group chat:
carg()cimag()conj()cproj()
and also, from the Base Definitions volume of POSIX.1β2017:
<complex.h>
π COPYRIGHT
okay legal moment, don't scroll, this matters:
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, bestie!! π«Ά this one came to you from IEEE/The Open Group, 2017 β CREAL(3POSIX), that's the one. go get that real part, you absolute icon πβ¨πΈπ¦
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms