creal(3)
π creal(3) β the get-the-real-part girlies π
okay bestie, welcome to creal(3) from the Library Functions Manual β¨ this is the page for creal, crealf, and creall β the trio whose whole entire job is pulling the real part out of a complex number. iconic behavior honestly π
πΈ LIBRARY πΈ
it lives in the Math library, and you link it like this: libm, -lm. slay π
β¨ SYNOPSIS β¨
#include <complex.h>
double creal(double complex z);
float crealf(float complex z);
long double creall(long double complex z);
three functions, three flavours, one vibe π¦
π DESCRIPTION π
so like, these functions return the real part of the complex number z. that's it. that's the whole job. and they ate π
the way it works is, you always have this relationship:
z = creal(z) + I * cimag(z)
no cap, that's literally the definition of what parts make up z π§
π ATTRIBUTES π
for the full rundown on what these terms even mean, go peek at attributes(7) π
creal(),crealf(),creall()β Thread safety: MT-Safe π
so yes bestie, they're thread safe, you can run them from multiple threads and it's giving totally fine π«Ά
π VERSIONS π
GCC also supports __real__. that one is a GNU extension β so it's a little extra, a little special, not standard β¨
β STANDARDS β
C11, POSIX.1-2008. periodt π
πΈ HISTORY πΈ
- glibc 2.1.
- C99, POSIX.1-2001.
the lore goes back a minute fr fr π
π₯ SEE ALSO π₯
go read those next, they're all in the same friend group π¦
lowkey reminder bestie:crealisn't doing any magic, it's just handing you the real piece. if you wanted the imaginary part, that'scimag's department, don't @ me π
and that's the whole page!! this one is from Linux man-pages 6.20, dated 2026-02-08 β shoutout to the maintainers, mwah π take care of yourself, hydrate, and go write some complex numbers πβ¨π«Ά
π¦ where this page comes from
- 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 6.20
- π the page's license: GPL-1.0-or-later
- Copyright 2002, Walter Harms <walter.harms@informatik.uni-oldenburg.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms