GeezerVison is showing cpprefjp.github.io — std::exp - cpprefjp C++日本語リファレンス
最終更新日時:
2026年09月11日 13時06分31秒 (JST)
Akira Takahashi
が更新
履歴
編集
function template
<complex>
std:: exp
namespace std {
template < class T >
complex < T >
exp ( const complex < T >& x ); // (1) C++98
template < class T >
constexpr complex < T >
exp ( const complex < T >& x ); // (1) C++26
}
概要
自然対数の底 e(ネイピア数)の複素数値による累乗を得る。exp は exponent(指数)、あるいは、exponential function(指数関数)の略。
戻り値
自然対数の底 e(ネイピア数)の引数 x による累乗。
備考
例
#include <iostream>
#include <complex>
int main ()
{
std :: complex < double > c ( 1.0 , 2.0 );
std :: complex < double > result = std::exp ( c );
std::cout << "exp( " << c << " ) = " << result << std::endl ;
}
出力
exp( (1,2) ) = (-1.1312,2.47173)
バージョン
言語
処理系
Clang : 3.0 ✅ , 3.1 ✅ , 3.2 ✅ , 3.3 ✅ , 3.4 ✅
GCC : 4.3.6 ✅ , 4.4.7 ✅ , 4.5.4 ✅ , 4.6.4 ✅ , 4.7.3 ✅ , 4.8.1 ✅ , 4.8.2 ✅ , 4.9.0 ✅
Visual C++ : ??
備考
libstdc++ では、通常 glibc の対応する関数を呼び出すため、上記の備考に記載した C99 の ISO IEC 60559 準拠要件を満たす。
しかし、glibc を使用していない libstdc++、および、libc++ は、当該要件を満たしていない(満たすつもりが無い?)ようである。
libstdc++ で glibc を使用している場合、使用している glibc のバージョンが 2.19 より前の場合には exp(complex(NaN, +0)) に対して complex(NaN, NaN) を返す。これは glibc のバグで 2.19 以降は直っている。
関連項目
名前
説明
acos
複素数の逆余弦を求める。
asin
複素数の逆正弦を求める。
atan
複素数の逆正接を求める。
acosh
複素数の双曲線逆余弦を求める。
asinh
複素数の双曲線逆正弦を求める。
atanh
複素数の双曲線逆正接を求める。
cos
複素数の余弦を求める。
cosh
複素数の双曲線余弦を求める。
log
複素数の自然対数を求める。
log10
複素数の常用対数を求める。
pow
複素数の累乗を求める。
sin
複素数の正弦を求める。
sinh
複素数の双曲線正弦を求める。
sqrt
複素数の平方根を求める。
tan
複素数の正接を求める。
tanh
複素数の双曲線正接を求める。
exp
自然対数の底 e の累乗(実数)を求める。
参照