?
This document uses PHP Chinese website manual Release
在頭文件<math.h>中定義 | ||
---|---|---|
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 <tgmath.h> | ||
#define exp( z ) | (4) | (since C99) |
1-3)計算復(fù)雜堿基?指數(shù)的z
。
4)類型 - 通用宏:如果z
有類型long
double
complex
,cexpl
被調(diào)用。如果z
有類型double
complex
,cexp
稱為,如果z
有類型float
complex
,cexpf
稱為。如果z
是真實的或整數(shù),則宏調(diào)用相應(yīng)的實函數(shù)(expf
,exp
,expl
)。如果z
是虛構(gòu)的,則調(diào)用相應(yīng)的復(fù)雜參數(shù)版本。
z | - | 復(fù)雜的論點 |
---|
如果沒有出現(xiàn)錯誤,e提高到電源z
, ez
返回。
報告的錯誤與math_errhandling一致。
如果實現(xiàn)支持IEEE浮點運算,
cexp(conj(z))
==
conj(cexp(z))
If z
is ±0+0i
, the result is 1+0i
If z
is x+∞i
(for any finite x), the result is NaN+NaNi
and FE_INVALID
is raised.
If z
is x+NaNi
(for any finite x), the result is NaN+NaNi
and FE_INVALID
may be raised.
If z
is +∞+0i
, the result is +∞+0i
If z
is -∞+yi
(for any finite y), the result is +0+cis(y)
If z
is +∞+yi
(for any finite nonzero y), the result is +∞+cis(y)
If z
is -∞+∞i
, the result is ±0±0i
(signs are unspecified)
If z
is +∞+∞i
, the result is ±∞+NaNi
and FE_INVALID
is raised (the sign of the real part is unspecified)
If z
is -∞+NaNi
, the result is ±0±0i
(signs are unspecified)
If z
is +∞+NaNi
, the result is ±∞+NaNi
(the sign of the real part is unspecified)
If z
is NaN+0i
, the result is NaN+0i
If z
is NaN+yi
(for any nonzero y), the result is NaN+NaNi
and FE_INVALID
may be raised
If z
is NaN+NaNi
, the result is NaN+NaNi
其中cis(y)是cos(y)+ i sin(y)。
復(fù)指數(shù)函數(shù)ez
對于z = x + iy等于ex
cis(y), or, ex
(cos(y) + i sin(y)).
指數(shù)函數(shù)是復(fù)平面中的一個完整函數(shù),并且沒有分支切割。
#include <stdio.h>#include <math.h>#include <complex.h> 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標(biāo)準(ISO / IEC 9899:2011):
7.3.7.1 cexp函數(shù)(p:194)
7.25類型通用數(shù)學(xué)<tgmath.h>(p:373-375)
G.6.3.1 cexp函數(shù)(p:543)
G.7類型 - 通用數(shù)學(xué)<tgmath.h>(p:545)
C99標(biāo)準(ISO / IEC 9899:1999):
7.3.7.1 cexp函數(shù)(p:176)
7.22類型通用數(shù)學(xué)<tgmath.h>(p:335-337)
G.6.3.1 cexp函數(shù)(p:478)
G.7類型 - 通用數(shù)學(xué)<tgmath.h>(p:480)