std::log
De 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. |
Déclaré dans l'en-tête <cmath> | ||
float log(float arg ); | ||
double log(double arg ); | ||
longdouble log(longdouble arg ); | ||
double log( Integral arg ); | (depuis C++11) | |
Calcule le naturel (base e) logarithme de
arg
.Original:
Computes the natural (base e) logarithm of
arg
.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.
Sommaire |
[modifier]Paramètres
arg | - | valeur du point flottant 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. |
[modifier]Retourne la valeur
logarithme naturel de
arg
. Original:
natural logarithm of
arg
. 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.
Erreur de domaine se produit si
arg
est négatif. NAN est retourné dans ce cas .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.
Erreur d'intervalle se produit si
arg
est 0. -HUGE_VAL est retourné dans ce cas . 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.
[modifier]Exemple
Le code suivant calcule le binaire (base 2') avec l'aide de logarithme logarithme naturel .
Original:
The following code computes the binary (base 2) logarithm with help of natural logarithm.
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.
#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';}
Résultat :
8
[modifier]Voir aussi
retours e à la puissance donné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. (fonction) | |
calcule commune (base 10) Logarithme (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. (fonction) | |
soulève un certain nombre à la puissance donnée (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. (fonction) | |
complexe logarithme naturel avec les coupures de ramification le long de l'axe réel négatif 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. (fonction générique) | |
applique la fonction std::log à chaque élément de 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. (fonction générique) |