2.1.16.3.4 log


Description

returns the logarithm of the complex value.


logarithm of base e

Syntax

complex log( complex z )


double log( double x )

Parameters

z
[input] the complex value whose logarithm is sought.


x
[input] independent variable

Return

The logarithm of a complex number


The logarithm of a double number

Examples

EX1

void    run_complex_log()
{
    complex        cc(100., 3.);
    
    // Display the log:
    out_complex("log = ", log(cc)); // Result is "log = 4.605620+0.029991i"
}


EX2

void    log_ex1()
{
    double        x = 7.389056;
    double        val = log(x);
    
    printf("log(%f) = %f\n", x, val);
}

Remark

See Also

ln,log10

Header to Include

origin.h

Reference