[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/numeric/math/log [Back]  [Original]

std::log cppreference.com
cppreference.com

std::log

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++17)
(C++20)
(C++11)
(C++11)
(C++17)
(C++17)
(C++20)
(C++20)
(C++11)
(C++17)
(C++20)
(C++23)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
 
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
/
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
-
(C++11)(C++11)(C++11)(C++11)(C++11)
 
<tbody> </tbody>
float log( float arg );
(1)
double log( double arg );
(2)
long double log( long double arg );
(3)
double log( Integral arg );
(4) ( C++11)
1-3) ( e) arg.
4) . 2) ( double).

arg

, ( e) arg ( ln(arg) log
e
(arg)
).

domain-, (NaN )

pole-, -HUGE_VAL, -HUGE_VALF -HUGE_VALL.

math_errhandling

Domain- , arg .

Pole- , arg .

IEEE (IEC 60559):

#include <iostream>
#include <cmath>
#include <cerrno>
#include <cstring>
#include <cfenv>
#pragma STDC FENV_ACCESS ON
int main()
{
    std::cout << "log(1) = " << std::log(1) << '\n'
              << " 125   5  " << std::log(125)/std::log(5) << '\n';
    //  
    std::cout << "log(1) = " << std::log(1) << '\n'
              << "log(+Inf) = " << std::log(INFINITY) << '\n';
    //  
    errno=0; std::feclearexcept(FE_ALL_EXCEPT);
    std::cout << "log(0) = " << std::log(0) << '\n';
    if(errno == ERANGE)
        std::cout << "    errno == ERANGE: " << std::strerror(errno) << '\n';
    if(std::fetestexcept(FE_DIVBYZERO))
        std::cout << "    FE_DIVBYZERO raised\n";
}

:

log(1) = 0
 125   5  3
log(1) = 0
log(+Inf) = inf
log(0) = -inf
    errno == ERANGE: Numerical result out of range
    FE_DIVBYZERO raised

.

(C++11)(C++11)
( 10) (\({\small \log_{10}{x} }\)log10(x))
() []
(C++11)(C++11)(C++11)
2 (\({\small \log_{2}{x} }\)log2(x))
() []
(C++11)(C++11)(C++11)
( e) 1 (\({\small \ln{(1+x)} }\)ln(1+x))
() []
(C++11)(C++11)
e (\({\small e^x}\)ex)
() []
,
( ) []
std::log valarray
( ) []
C log

Web Proxy Viewer  |  New URL  |  Original Page