©
本文档使用
php中文网手册 发布
在头文件<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被调用。如果z有类型float complex,float imaginary或者float,cimagf被调用。如果z有类型double complex,double imaginary,double,或任何整数类型,cimag被调用。
z | - | 复杂的论点 |
|---|
虚构的部分z。
This function is fully specified for all possible inputs and is not subject to any errors described in math_errhandling.
对于任何复杂的变量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标准(ISO / IEC 9899:2011):
7.3.9.2 cimag函数(p:197)
7.25类型通用数学<tgmath.h>(p:373-375)
G.7类型 - 通用数学<tgmath.h>(p:545)
C99标准(ISO / IEC 9899:1999):
7.3.9.2 cimag函数(p:178-179)
7.22类型通用数学<tgmath.h>(p:335-337)
G.7类型 - 通用数学<tgmath.h>(p:480)