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: creal isn't doing any magic, it's just handing you the real piece. if you wanted the imaginary part, that's cimag'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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms