std:: real (std::complex)
|
ヘッダーで定義
<complex>
|
||
| (1) | ||
|
template
<
class
T
>
T real ( const std:: complex < T > & z ) ; |
(C++14まで) | |
|
template
<
class
T
>
constexpr T real ( const std:: complex < T > & z ) ; |
(C++14から) | |
|
追加のオーバーロード
(C++11から)
|
||
|
ヘッダーで定義
<complex>
|
||
| (A) | ||
|
float
real
(
float
f
)
;
double
real
(
double
f
)
;
|
(C++14まで) | |
|
constexpr
float
real
(
float
f
)
;
constexpr
double
real
(
double
f
)
;
|
(C++14から)
(C++23まで) |
|
|
template
<
class
FloatingPoint
>
constexpr FloatingPoint real ( FloatingPoint f ) ; |
(C++23から) | |
| (B) | ||
|
template
<
class
Integer
>
double real ( Integer i ) ; |
(C++14まで) | |
|
template
<
class
Integer
>
constexpr double real ( Integer i ) ; |
(C++14から) | |
|
A,B)
すべての整数型および浮動小数点型に対して追加のオーバーロードが提供されており、これらは虚数部がゼロの複素数として扱われます。
|
(C++11以降) |
目次 |
パラメータ
| z | - | 複素数値 |
| f | - | 浮動小数点値 |
| i | - | 整数値 |
戻り値
注記
追加のオーバーロードは (A,B) と厳密に同じ形式で提供される必要はありません。それらは引数 num に対して以下を保証するのに十分であればよいのです:
-
num
が
標準
(C++23まで)
浮動小数点型
Tを持つ場合、 std :: real ( num ) は std :: real ( std:: complex < T > ( num ) ) と同じ効果を持つ。 - それ以外の場合、 num が整数型を持つ場合、 std :: real ( num ) は std :: real ( std:: complex < double > ( num ) ) と同じ効果を持つ。
関連項目
|
複素数の実部にアクセスする
(public member function) |
|
|
虚部を返す
(function template) |
|
|
C documentation
for
creal
|
|