ccos(3)
π ccos β complex cosine, but make it serve π
okay bestie, come sit with me, because today we are cosining... complexly. β¨ this little page is about ccos, plus its two glow-up twins ccosf and ccosl β the complex cosine function. yes, complex as in complex numbers, not complex as in "why is math like this". π¦
π LIBRARY
the math library, babes: libm, which you link with -lm. (the l is for "love", probably. it's for library. whatever. π«Ά)
β¨ SYNOPSIS β¨
first you gotta invite the header to the party:
#include <complex.h>
then here are the three icons themselves, in all their glory:
double complex ccos(double complex z);
float complex ccosf(float complex z);
long double complex ccosl(long double complex z);
like, ccos for double complex, ccosf for float complex, ccosl for long double complex. the f and l suffixes are basically the outfit changes. π
πΈ DESCRIPTION πΈ
these functions calculate the complex cosine of z. that's it. that's the job. no cap.
and because the vibes must be mathematically rigorous, the complex cosine function is defined as:
ccos(z) = (exp(i * z) + exp(-i * z)) / 2
look at her. two exponentials, one imaginary unit, a lil sum, divided by two. it's giving Euler's formula energy and honestly? obsessed. π
π ATTRIBUTES π
for an explanation of the terms used in this section, go read attributes(7) β it's the glossary, bestie, it explains what all these words mean.
ccos(),ccosf(),ccosl()β Thread safety: MT-Safe. translation: she is safe to use across multiple threads, she does not start drama, she does not corrupt your data. a well-behaved queen. π
β STANDARDS β
C11POSIX.1-2008
so yes, she's officially certified. standards-approved. the committee said "slay" and put it in writing. πβ¨
π¦ HISTORY π¦
- glibc 2.1 β when she first arrived on the scene.
C99,POSIX.1-2001β the standards she's been repping for ages.
she's been iconic since glibc 2.1 and she has NOT slowed down. veteran behavior. π«Ά
π₯ SEE ALSO π₯
the whole extended universe, go read them:
complex(7) is literally the group chat β start there if you're new here. iykyk. π
and that's the whole page, bestie!! this one came from Linux man-pages 6.20, dated 2026-02-08 β so you know it's fresh. drink water, link with -lm, and go cosine something complex. mwah. πβ¨π
π¦ 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