clog(3)
π clog(3) β bestie edition π
ok so we're in the Library Functions Manual and today's main character is clog(3) π«Ά grab a snack, this one's actually so cute once you get it.
β¨ NAME β¨
clog, clogf, clogl β the natural logarithm of a complex number πΈ
β¨ LIBRARY β¨
Math library (libm, link it with -lm) β¨
β¨ SYNOPSIS β¨
lowkey the whole vibe is right here:
#include <complex.h>
double complex clog(double complex z);
float complex clogf(float complex z);
long double complex clogl(long double complex z);
β¨ DESCRIPTION β¨
okay so these functions calculate the complex natural logarithm of z, and there's a branch cut along the negative real axis π
(yes, the cut is part of the lore, we don't make the rules).
The logarithm clog() is the inverse function of the exponential cexp(3). So like, if y = clog(z), then z = cexp(y) π¦. And the imaginary part of y is chosen in the interval [-pi,pi] β she stays in her lane, no cap.
One has:
clog(z) = log(cabs(z)) + I * carg(z)
heads up bestie π note that z close to zero will cause an overflow. it's giving danger, so watch out for that.
β¨ ATTRIBUTES β¨
for an explanation of the terms used in this section, see attributes(7) π
- Interface:
clog(),clogf(),clogl() - Attribute: Thread safety
- Value:
MT-Safe
so yeah, thread safety is MT-Safe, we love a safe girlie β¨
β¨ STANDARDS β¨
C11, POSIX.1-2008. periodt π
β¨ HISTORY β¨
glibc 2.1. And also C99, POSIX.1-2001 β she's been iconic for a minute π
β¨ SEE ALSO β¨
cabs(3), cexp(3), clog10(3), clog2(3), complex(7) π
and that's the whole page bestie π iykyk. this lil masterpiece came to you from Linux man-pages 6.20, dated 2026-02-08, and yes it's a clog(3) situation π mwah, go log something complex π§
π¦ 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