méthode log JavaScript ()
Définition et utilisation
log () retourne un certain nombre de logarithme naturel (basé sur E).
NOTE: Si x est négatif, retourner NaN.
NOTE: Si x est 0, retourne -Infinity.
support du navigateur
Tous méthode journal majeur de support de navigateurs ()
grammaire
Math.log( x )
Paramètre Valeur
参数 | 描述 |
---|---|
x | 必需。任意数值或表达式。 |
Valeur de retour
类型 | 描述 |
---|---|
Number | x 的自然对数。 |
détails techniques
Version JavaScript: | 1.0 |
---|
D'autres exemples
Exemples
Dans cet exemple, nous allons utiliser un nombre différent de log ():
var a=Math.log(2.7183);
var b=Math.log(2);
var c=Math.log(1);
var d=Math.log(0);
var e=Math.log(-1);
var b=Math.log(2);
var c=Math.log(1);
var d=Math.log(0);
var e=Math.log(-1);
a, b, c, d et e du moteur:
1.0000066849139877
0.6931471805599453
0
-Infinity
NaN
0.6931471805599453
0
-Infinity
NaN
Essayez »