conjf, conj, conjl
|
定义于头文件
<complex.h> |
||
| (1) | (C99 起) | |
| (2) | (C99 起) | |
| (3) | (C99 起) | |
|
定义于头文件
<tgmath.h> |
||
|
#define conj( z )
|
(4) | (C99 起) |
4) 泛型宏:若
z 拥有 long double complex 、 long double imaginary 或 long double 类型,则调用 conjl 。若 z 拥有 float complex 、 float imaginary 或 float 类型,则调用 conjf 。若 z 拥有 double complex 、 double imaginary 、 double 或任何整数类型,则调用 conj 。参数
| z | - | 复参数 |
返回值
z 的共轭复数。
注意
在不实现 I 为 _Imaginary_I 的 C99 实现上,可用 conj 获得拥有负零虚部的复数。 C11 中,宏 CMPLX 用于此目的。
示例
输出:
The conjugate of 1.0+2.0i is 1.0-2.0i Their product is 5.0+0.0i
引用
- C11 标准(ISO/IEC 9899:2011):
-
- 7.3.9.4 The conj functions (p: 198)
-
- 7.25 Type-generic math <tgmath.h> (p: 373-375)
-
- G.7 Type-generic math <tgmath.h> (p: 545)
- C99 标准(ISO/IEC 9899:1999):
-
- 7.3.9.3 The conj functions (p: 179)
-
- 7.22 Type-generic math <tgmath.h> (p: 335-337)
-
- G.7 Type-generic math <tgmath.h> (p: 480)