crealf, creal, creall
|
在标头
<complex.h> 定义 |
||
|
float crealf( float complex z );
|
(1) | (C99 起) |
|
double creal( double complex z );
|
(2) | (C99 起) |
|
long double creall( long double complex z );
|
(3) | (C99 起) |
|
在标头
<tgmath.h> 定义 |
||
|
#define creal( z )
|
(4) | (C99 起) |
1-3) 返回
z 的实部。4) 泛型宏:若
z 拥有 long double complex、long double imaginary 或 long double 类型,则调用 creall。若 z 拥有 float complex、float imaginary 或 float 类型,则调用 crealf。若z 拥有 double complex、double imaginary 或 double 类型,或任何整数类型,则调用 creal。参数
| z | - | 复数实参 |
返回值
z 的实部
此函数对所有可能输入指明,而且不受制于任何描述于 math_errhandling 的错误。
注意
对于任何复变量 z,z == creal(z) + I*cimag(z)。
示例
输出:
1.000000+2.000000i
引用
- C11 标准(ISO/IEC 9899:2011):
-
- 7.3.9.6 The creal functions (第 198-199 页)
-
- 7.25 Type-generic math <tgmath.h> (第 373-375 页)
-
- G.7 Type-generic math <tgmath.h> (第 545 页)
- C99 标准(ISO/IEC 9899:1999):
-
- 7.3.9.5 The creal functions (第 180 页)
-
- 7.22 Type-generic math <tgmath.h> (第 335-337 页)
-
- G.7 Type-generic math <tgmath.h> (第 480 页)
参阅
|
(C99)(C99)(C99)
|
计算复数的虚部 (函数) |