La référence javascript : Objets, méthodes, propriétés

Méthode : Math.log()
Retourne le logarithme népérien (ln) du réel passé en paramètre
Compatible :

Syntaxe
Float Math.log(Float x)

Description
Retourne le logarithme népérien (ln) du réel passé en paramètre.

Rappel : y = ln(x) est équivalent à x = exp(y)
exp() étant la fonction exponentielle

Donc en javascript, la condition
Math.log(Math.exp(x)) == x
sera toujours vraie.


Exemple Utilisation
Code source
<SCRIPT TYPE="text/javascript">
  document.write('ln(1) = '+Math.log(1)+'<BR>');
  document.write('ln(0) = '+Math.log(0)+'<BR>');
  document.write('ln(exp(4)) = '+Math.log(Math.exp(4))+'<BR>');
</SCRIPT>


Résultat


Explication
Essai de la méthode "Math.log()" (logarithme népérien) avec quelques valeurs.


Page en rapport
Les fonctions mathématiques en javascript



Reproduction ou diffusion interdite sans autorisation de Tout JavaScript.com