crealf, creal, creall
來自 cppreference.com
| 定義在標頭檔案 <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 (p: 198-199)
- 7.25 型別通用數學 <tgmath.h> (p: 373-375)
- G.7 型別通用數學 <tgmath.h> (p: 545)
- C99 標準 (ISO/IEC 9899:1999)
- 7.3.9.5 The creal functions (p: 180)
- 7.22 型別通用數學 <tgmath.h> (p: 335-337)
- G.7 型別通用數學 <tgmath.h> (p: 480)
[編輯] 參閱
| (C99)(C99)(C99) |
計算複數的虛部 (函式) |
| C++ 文件 用於 real
| |