当前位置: C语言 -- 标准库 -- <complex.h> -- clogl

clogl函数


概要:
#include <complex.h>
long double complex clogl(long double complex z);

描述:

该函数计算参数z的复自然对数(e为底数)值,沿负实轴区间进行分支切割(branch cut)。


参数:
long double complex z

参数为一个long double complex类型的复数。


返回值:

函数返回参数z的复自然对数值,返回值位于虚轴区间clogl函数返回值的虚轴区间、实轴无限制的范围内。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
/*函数clogl范例*/

#ifdef __STDC_NO_COMPLEX__
#error "Implementation does not support complex types."
#endif

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

int main(void)
{
    long double complex x = 1.0L + 1.0LI;
    long double complex y;
    char *ptr = "clogl(1.0L + 1.0Li)";

    y = clogl(x);
    printf("%s = %.2Lf%+.2Lfi\n", ptr, creall(y),cimagl(y));

    return 0;
}

输出:

clogl(1.0L + 1.0Li) = 0.35+0.79i


相关内容:
clog double complex类型的以e为底数的复变对数函数。
clogf float complex类型的以e为底数的复变对数函数。