| 1 |
'\" t |
| 2 |
.\" Copyright 2002, Walter Harms <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-1.0-or-later |
| 6 |
.\" |
| 7 |
.TH clog 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
clog, clogf, clogl \- natural logarithm of a complex number |
| 10 |
.SH LIBRARY |
| 11 |
Math library |
| 12 |
.RI ( libm ,\~ \-lm ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <complex.h> |
| 16 |
.P |
| 17 |
.BI "double complex clog(double complex " z ); |
| 18 |
.BI "float complex clogf(float complex " z ); |
| 19 |
.BI "long double complex clogl(long double complex " z ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
These functions calculate the complex natural logarithm of |
| 23 |
.IR z , |
| 24 |
with a branch cut along the negative real axis. |
| 25 |
.P |
| 26 |
The logarithm |
| 27 |
.BR clog () |
| 28 |
is the inverse function of the exponential |
| 29 |
.BR cexp (3). |
| 30 |
Thus, if |
| 31 |
.IR "y\ =\ clog(z)" , |
| 32 |
then |
| 33 |
.IR "z\ =\ cexp(y)" . |
| 34 |
The imaginary part of |
| 35 |
.I y |
| 36 |
is chosen in the interval [\-pi,pi]. |
| 37 |
.P |
| 38 |
One has: |
| 39 |
.P |
| 40 |
.in +4n |
| 41 |
.EX |
| 42 |
clog(z) = log(cabs(z)) + I * carg(z) |
| 43 |
.EE |
| 44 |
.in |
| 45 |
.P |
| 46 |
Note that |
| 47 |
.I z |
| 48 |
close to zero will cause an overflow. |
| 49 |
.SH ATTRIBUTES |
| 50 |
For an explanation of the terms used in this section, see |
| 51 |
.BR attributes (7). |
| 52 |
.TS |
| 53 |
allbox; |
| 54 |
lbx lb lb |
| 55 |
l l l. |
| 56 |
Interface Attribute Value |
| 57 |
T{ |
| 58 |
.na |
| 59 |
.nh |
| 60 |
.BR clog (), |
| 61 |
.BR clogf (), |
| 62 |
.BR clogl () |
| 63 |
T} Thread safety MT-Safe |
| 64 |
.TE |
| 65 |
.SH STANDARDS |
| 66 |
C11, POSIX.1-2008. |
| 67 |
.SH HISTORY |
| 68 |
glibc 2.1. |
| 69 |
C99, POSIX.1-2001. |
| 70 |
.SH SEE ALSO |
| 71 |
.BR cabs (3), |
| 72 |
.BR cexp (3), |
| 73 |
.BR clog10 (3), |
| 74 |
.BR clog2 (3), |
| 75 |
.BR complex (7) |