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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms