std::log
Aus 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. |
definiert in Header <cmath>
|
||
float log( float arg ); |
||
double log( double arg ); |
||
long double log( long double arg ); |
||
double log( Integral arg ); |
(seit C++11) | |
Computes the natural (base e) logarithm of arg
.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
arg | - | Floating-Point-Wert
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. |
[Bearbeiten] Rückgabewert
natural logarithm of arg
.
Domain-Fehler tritt auf, wenn
arg
negativ ist. NAN wird in diesem Fall wieder .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.
Bereichs-Fehler tritt auf, wenn
arg
ist 0. -HUGE_VAL wird in diesem Fall wieder . 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.
[Bearbeiten] Beispiel
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'; }
Output:
8
[Bearbeiten] Siehe auch
Renditen e an die angegebene Leistung (ex) angehoben 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. (Funktion) | |
berechnet gemeinsamen (base 10) Logarithmus (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. (Funktion) | |
wirft eine Reihe an die angegebene Leistung (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. (Funktion) | |
komplexen natürlichen Logarithmus mit den Niederlassungen Schnitte entlang der negativen reellen Achse 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. (Funktions-Template) | |
wendet die Funktion std::log auf jedes Element valarray 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. (Funktions-Template) |