©
This document usesPHP Chinese website manualRelease
|
在头文件 |
|
|
|---|---|---|
|
float complex cexpf( float complex z ); |
(1) |
(since C99) |
|
double complex cexp( double complex z ); |
(2) |
(since C99) |
|
long double complex cexpl( long double complex z ); |
(3) |
(since C99) |
|
Defined in header |
|
|
|
#define exp( z ) |
(4) |
(since C99) |
1-3)计算复杂碱基Ë指数的z。
4)类型 - 通用宏:如果z有类型longdoublecomplex,cexpl被调用。如果z有类型doublecomplex,cexp称为,如果z有类型floatcomplex,cexpf称为。如果z是真实的或整数,则宏调用相应的实函数(expf,exp,expl)。如果z是虚构的,则调用相应的复杂参数版本。
|
z |
- |
复杂的论点 |
|---|
如果没有出现错误,e提高到电源z, ez
返回。
报告的错误与math_errhandling一致。
如果实现支持IEEE浮点运算,
cexp(conj(z))==conj(cexp(z))
Ifzis±0+0i, the result is1+0i
Ifzisx+∞i(for any finite x), the result isNaN+NaNiandFE_INVALIDis raised.
Ifzisx+NaNi(for any finite x), the result isNaN+NaNiandFE_INVALIDmay be raised.
Ifzis+∞+0i, the result is+∞+0i
Ifzis-∞+yi(for any finite y), the result is+0+cis(y)
Ifzis+∞+yi(for any finite nonzero y), the result is+∞+cis(y)
Ifzis-∞+∞i, the result is±0±0i(signs are unspecified)
Ifzis+∞+∞i, the result is±∞+NaNiandFE_INVALIDis raised (the sign of the real part is unspecified)
Ifzis-∞+NaNi, the result is±0±0i(signs are unspecified)
Ifzis+∞+NaNi, the result is±∞+NaNi(the sign of the real part is unspecified)
IfzisNaN+0i, the result isNaN+0i
IfzisNaN+yi(for any nonzero y), the result isNaN+NaNiandFE_INVALIDmay be raised
IfzisNaN+NaNi, the result isNaN+NaNi
其中cis(y)是cos(y)+ i sin(y)。
复指数函数ez
对于z = x + iy等于ex
cis(y), or, ex
(cos(y) + i sin(y)).
指数函数是复平面中的一个完整函数,并且没有分支切割。
#include#include #include int main(void){ double PI = acos(-1); double complex z = cexp(I * PI); // Euler's formula printf("exp(i*pi) = %.1f%+.1fi\n", creal(z), cimag(z)); }
输出:
exp(i*pi) = -1.0+0.0i
C11标准(ISO / IEC 9899:2011):
7.3.7.1 cexp函数(p:194)
7.25类型通用数学
G.6.3.1 cexp函数(p:543)
G.7类型 - 通用数学
C99标准(ISO / IEC 9899:1999):
7.3.7.1 cexp函数(p:176)
7.22类型通用数学
G.6.3.1 cexp函数(p:478)
G.7类型 - 通用数学