cexp(3)

✨ cexp(3) β€” it's giving complex exponential, bestie ✨

okay so real talk, this page lives in section 3 of the manual (that's the library-functions girlies, cexp(3), we been knew πŸ’…), and it's genuinely one of the cutest little math pages out there. sit down, sip ur drink, let's go πŸ“


🌸 NAME 🌸

cexp, cexpfr wait no β€” cexp, cexpf, cexpl β€” the complex exponential function πŸ’– that's the whole vibe.


πŸ“š LIBRARY πŸ“š

Math library, aka libm, and you link it with -lm like a normal person. no cap. 🧚


πŸŽ€ SYNOPSIS πŸŽ€

#include <complex.h>

double complex cexp(double complex z);
float complex cexpf(float complex z);
long double complex cexpl(long double complex z);

three flavours, one queen behaviour: double, float, and long double precision, each one taking its matching complex type. slay. πŸ‘‘


πŸ’« DESCRIPTION πŸ’«

So here's the tea: these functions calculate e β€” that's 2.71828..., the base of natural logarithms, the iconic irrational number herself β€” raised to the power of z. ✨

Like, mathematically speaking:

cexp(I * z) = ccos(z) + I * csin(z)

and honestly? that identity is main character energy. it's the whole reason complex exponentials show up everywhere in signals and physics and all that. you're welcome. πŸ¦‹


πŸ”₯ ATTRIBUTES πŸ”₯

if you're confused about what any of these fancy words mean, go read attributes(7), she explains everything. for real.

  • cexp(), cexpf(), cexpl() β€” Thread safety: MT-Safe βœ… but like, of course they are. iconic, no notes.
ngl the original had a whole table here but the info is just: all three of these bad boys are MT-Safe, periodt. 🫢

⭐ STANDARDS ⭐

  • C11
  • POSIX.1-2008

that's the standard-compliance vibe check and they both passed. no cap. πŸ’œ


🧚 HISTORY 🧚

  • glibc 2.1 β€” when she first showed up in glibc πŸŽ€
  • C99, POSIX.1-2001 β€” where she was standardised first

a true legend. she's been in the game for a minute. πŸ‘‘


🌈 SEE ALSO 🌈

the whole friend group, go say hi:


and that's the page bestie!! πŸ˜­πŸ’– this love letter comes to you courtesy of Linux man-pages 6.20, dated 2026-02-08 β€” so if you cite it, cite it cute. go forth and compute ur complex exponentials. obsessed with you. bye!! πŸ¦‹βœ¨πŸŽ€

πŸ“¦ 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