--- title: Math.LN2 slug: Web/JavaScript/Reference/Global_Objects/Math/LN2 tags: - JavaScript - Math - Property - Referencia translation_of: Web/JavaScript/Reference/Global_Objects/Math/LN2 original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/LN2 ---
La propiedad Math.LN2 representa el logaritmo natural de 2, aproximadamente 0.693:
Como LN2 es una propiedad estática de Math, siempre se usa como Math.LN2, en lugar de como una propiedad de un objeto Math que ha creado (Math no es un constructor).
Math.LN2La función siguiente devuelve el logaritmo natural de 2:
function getNatLog2() {
return Math.LN2;
}
getNatLog2(); // 0.6931471805599453
| Especificación | Estado | Comentario |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implementado en JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.8.1.3', 'Math.LN2')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.ln2', 'Math.LN2')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-math.ln2', 'Math.LN2')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.LN2")}}