Difference between revisions of "cpp/numeric/math/log1p"
m (+integral overload) |
m (Text replace - "{{cpp|" to "{{c|") |
||
Line 17: | Line 17: | ||
{{ddcl list end}} | {{ddcl list end}} | ||
− | Computes the natural (base {{ | + | Computes the natural (base {{c|e}}) logarithm of {{c|1+arg}}. This function is more precise than the expression {{c|std::log(1+arg)}} if {{tt|arg}} is close to zero. |
===Parameters=== | ===Parameters=== | ||
Line 28: | Line 28: | ||
{{math|ln(1+arg)}} | {{math|ln(1+arg)}} | ||
− | Domain error occurs if {{tt|arg}} is negative. {{ | + | Domain error occurs if {{tt|arg}} is negative. {{c|NAN}} is returned in that case. |
− | Range error occurs if {{tt|arg}} is {{ | + | Range error occurs if {{tt|arg}} is {{c|0}}. {{c|-HUGE_VAL}} is returned in that case. |
===See also=== | ===See also=== |
Revision as of 20:26, 19 April 2012
Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><cmath>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td ><td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td ><td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td ><td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">
<td ><td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end
Computes the natural (base e) logarithm of 1+arg. This function is more precise than the expression std::log(1+arg) if arg
is close to zero.
Parameters
arg | - | floating point value |
Return value
ln(1+arg)
Domain error occurs if arg
is negative. NAN is returned in that case.
Range error occurs if arg
is 0. -HUGE_VAL is returned in that case.