clogf, clog, clogl - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# clogf, clog, clogl

From cppreference.com
< c‎ | numeric‎ | complex

Defined in header `<complex.h>` |  |
float complex clogf( float complex z ); |  | (since C99)
double complex clog( double complex z ); |  | (since C99)
long double complex clogl( long double complex z ); |  | (since C99)

Computes the complex natural (base-e) logarithm of `z` with branch cut along the negative real axis.

### [edit] Parameters

z | - | complex argument

### [edit] Return value

The complex natural logarithm of `z` in the interval (−∞; +∞) along the real axis and in the interval (−iπ; +iπ) along the imaginary axis.

### [edit] Example

Run this code

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

    int main(void)
    {
        double complex z = clog(1.0 + 2.0*I);
        printf("%f%+fi\n", creal(z), cimag(z));

        return 0;
    }

Output:

    0.804719+1.107149i

### [edit] See also

cexpcexpfcexpl (C99)(C99)(C99) | computes the complex base-e exponential (function) [edit]
loglogflogl (C99)(C99) | computes natural (base-e) logarithm (ln(x)) (function) [edit]
C++ documentation for log

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/numeric/complex/clog&oldid=70635"