std::log
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <cmath> | ||
float log(float arg ); | ||
double log(double arg ); | ||
longdouble log(longdouble arg ); | ||
double log( Integral arg ); | (dal C++11) | |
Computes the natural (base e) logarithm of arg
.
Indice |
[modifica]Parametri
arg | - | valore in virgola mobile 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. |
[modifica]Valore di ritorno
natural logarithm of arg
.
Errore di dominio si verifica se
arg
è negativo. NAN viene restituito in questo caso.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.
Campo errore si verifica se è
arg
0. -HUGE_VAL viene restituito in questo caso. 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.
[modifica]Esempio
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
[modifica]Vedi anche
ritorna e elevato alla potenza data (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. (funzione) | |
calcola comune (base 10) logaritmo (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. (funzione) | |
solleva un numero alla potenza data (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. (funzione) | |
complesso logaritmo naturale con i rami di lungo l'asse reale negativo 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. (funzione di modello) | |
applica la std::log funzione a ogni elemento di 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. (funzione di modello) |