## Linux and UNIX Man Pages

Test Your Knowledge in Computers #616
Difficulty: Medium
There is no separate char data type in Python.
True or False?

# clog(3) [redhat man page]

```CLOG(3)                                                      Linux Programmer's Manual                                                     CLOG(3)

NAME
clog, clogf, clogl - natural logarithm of a complex number

SYNOPSIS
#include <complex.h>

double complex clog(double complex z);
float complex clogf(float complex z);
long double complex clogl(long double complex z);

DESCRIPTION
These functions calculate the complex natural logarithm of z, with a branch cut along the negative real axis.

The  logarithm clog() is the inverse function of the exponential cexp(3).  Thus, if y = clog(z), then z = cexp(y).  The imaginary part of y
is chosen in the interval [-pi,pi].

One has:

clog(z) = log(cabs(z)) + I * carg(z)

Note that z close to zero will cause an overflow.

VERSIONS
These functions first appeared in glibc in version 2.1.

ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).

+-------------------------+---------------+---------+
|Interface                | Attribute     | Value   |
+-------------------------+---------------+---------+
|clog(), clogf(), clogl() | Thread safety | MT-Safe |
+-------------------------+---------------+---------+
CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008.

cabs(3), cexp(3), clog10(3), clog2(3), complex(7)

COLOPHON
This page is part of release 4.15 of the Linux man-pages project.  A description of the project, information about reporting bugs, and  the

2017-09-15                                                             CLOG(3)```

## Check Out this Related Man Page

```CATAN(3)						     Linux Programmer's Manual							  CATAN(3)

NAME
catan, catanf, catanl - complex arc tangents

SYNOPSIS
#include <complex.h>

double complex catan(double complex z);
float complex catanf(float complex z);
long double complex catanl(long double complex z);

DESCRIPTION
These  functions  calculate the complex arc tangent of z.  If y = catan(z), then z = ctan(y).  The real part of y is chosen in the interval
[-pi/2,pi/2].

One has:

catan(z) = (clog(1 + i * z) - clog(1 - i * z)) / (2 * i)

VERSIONS
These functions first appeared in glibc in version 2.1.

ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).

+----------------------------+---------------+---------+
|Interface		    | Attribute     | Value   |
+----------------------------+---------------+---------+
|catan(), catanf(), catanl() | Thread safety | MT-Safe |
+----------------------------+---------------+---------+
CONFORMING TO
C99, POSIX.1-2001, POSIX.1-2008.

EXAMPLE

#include <complex.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
double complex z, c, f;
double complex i = I;

if (argc != 3) {
fprintf(stderr, "Usage: %s <real> <imag>
", argv);
exit(EXIT_FAILURE);
}

z = atof(argv) + atof(argv) * I;

c = catan(z);
printf("catan() = %6.3f %6.3f*i
", creal(c), cimag(c));

f = (clog(1 + i * z) - clog(1 - i * z)) / (2 * i);
printf("formula = %6.3f %6.3f*i
", creal(f2), cimag(f2));

exit(EXIT_SUCCESS);
}