std::log
来自cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
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.
Output:
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. (函数模板) | |
std::logvalarray的每个元素的功能 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. (函数模板) |