Difference between revisions of "cpp/numeric/math/log1p"
From cppreference.com
m (Shorten template names. Use {{lc}} where appropriate.) |
|||
Line 1: | Line 1: | ||
{{cpp/title|log1p}} | {{cpp/title|log1p}} | ||
{{cpp/numeric/math/navbar}} | {{cpp/numeric/math/navbar}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{dcl header | cmath}} |
− | {{ | + | {{dcl |notes={{mark since c++11}}| |
float log1p( float arg ); | float log1p( float arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl |notes={{mark since c++11}}| |
double log1p( double arg ); | double log1p( double arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl |notes={{mark since c++11}}| |
long double log1p( long double arg ); | long double log1p( long double arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl |notes={{mark since c++11}}| |
double log1p( Integral arg ); | double log1p( Integral arg ); | ||
}} | }} | ||
− | {{ | + | {{dcl end}} |
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. | 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=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | arg | floating point value}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 28: | Line 28: | ||
{{math|ln(1+arg)}} | {{math|ln(1+arg)}} | ||
− | Domain error occurs if {{tt|arg}} is less than {{c|-1}}. {{ | + | Domain error occurs if {{tt|arg}} is less than {{c|-1}}. {{lc|NAN}} is returned in that case. |
Range error occurs if {{tt|arg}} is {{c|-1}}. {{c|-HUGE_VAL}} is returned in that case. | Range error occurs if {{tt|arg}} is {{c|-1}}. {{c|-HUGE_VAL}} is returned in that case. | ||
Line 34: | Line 34: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list log}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list expm1}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list log10}} |
− | {{ | + | {{dsc inc | cpp/numeric/math/dcl list log2}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/numeric/math/log1p]] | [[de:cpp/numeric/math/log1p]] |
Revision as of 19:20, 31 May 2013
Defined in header <cmath>
|
||
float log1p( float arg ); |
(since C++11) | |
double log1p( double arg ); |
(since C++11) | |
long double log1p( long double arg ); |
(since C++11) | |
double log1p( Integral arg ); |
(since C++11) | |
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 less than -1. NAN is returned in that case.
Range error occurs if arg
is -1. -HUGE_VAL is returned in that case.