?
This document uses PHP Chinese website manual Release
在頭文件<math.h>中定義 | ||
---|---|---|
float cimagf( float complex z ); | (1) | (since C99) |
double cimag( double complex z ); | (2) | (since C99) |
long double cimagl( long double complex z ); | (3) | (since C99) |
Defined in header <tgmath.h> | ||
#define cimag( z ) | (4) | (since C99) |
1-3)返回的虛部z
。
4)式泛型宏:如果z
具有類型long
double
complex
,long
double
imaginary
或long double
,cimagl
被調(diào)用。如果z
有類型float
complex
,float
imaginary
或者float
,cimagf
被調(diào)用。如果z
有類型double
complex
,double
imaginary
,double
,或任何整數(shù)類型,cimag
被調(diào)用。
z | - | 復(fù)雜的論點(diǎn) |
---|
虛構(gòu)的部分z
。
This function is fully specified for all possible inputs and is not subject to any errors described in math_errhandling.
對(duì)于任何復(fù)雜的變量z
,z ==
creal(z)
+ I*cimag(z)
。
#include <stdio.h>#include <complex.h> int main(void){ double complex z = 1.0 + 2.0*I; printf("%f%+fi\n", creal(z), cimag(z));}
輸出:
1.000000+2.000000i
C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):
7.3.9.2 cimag函數(shù)(p:197)
7.25類型通用數(shù)學(xué)<tgmath.h>(p:373-375)
G.7類型 - 通用數(shù)學(xué)<tgmath.h>(p:545)
C99標(biāo)準(zhǔn)(ISO / IEC 9899:1999):
7.3.9.2 cimag函數(shù)(p:178-179)
7.22類型通用數(shù)學(xué)<tgmath.h>(p:335-337)
G.7類型 - 通用數(shù)學(xué)<tgmath.h>(p:480)