std::log
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
Defined in header <cmath>
|
||
float log( float arg ); |
||
double log( double arg ); |
||
long double log( long double arg ); |
||
double log( Integral arg ); |
(C++11およびそれ以降) | |
Computes the natural (base e) logarithm of arg
.
目次 |
[編集] パラメータ
arg | - | 浮動小数点値
Original: floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
natural logarithm of arg
.
arg
が負の場合はドメイン·エラーが発生します。 NANはその場合に返されます.Original:
Domain error occurs if
arg
is negative. NAN is returned in that case.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
arg
0場合、範囲エラーが発生します。 -HUGE_VALはその場合に返されます. Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
The following code computes the binary (base 2) logarithm with help of natural logarithm.
このコードを実行します
#include <cmath> #include <iostream> int main() { double base = 2.0; double arg = 256.0; double result = std::log(arg) / std::log(base); std::cout << result << '\n'; }
出力:
8
[編集] も参照してください
戻り eを与えられた電力(ex)に引き上げた Original: returns e raised to the given power (ex) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
計算するコモン(ベース 10)対数(log10(x)) Original: computes common (base 10) logarithm (log10(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
与えられた電力(xy)に番号を発生させます Original: raises a number to the given power (xy) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
負の実軸に沿って分岐切断線を持つ複雑な自然対数 Original: complex natural logarithm with the branch cuts along the negative real axis The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |
valarrayの各要素に関数を適用しstd::log Original: applies the function std::log to each element of valarray The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |