Math.LN2
La propiedad Math.LN2
representa el logaritmo natural de 2, aproximadamente 0.693:
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Atributos de la propiedad Math.LN2 |
|
---|---|
Sobrescribir | No |
Numerable | No |
Configurable | No |
Descripción
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).
Ejemplos
Utilizando Math.LN2
La función siguiente devuelve el logaritmo natural de 2:
function getNatLog2() {
return Math.LN2;
}
getNatLog2(); // 0.6931471805599453
Especificaciones
Especificación | Estado | Comentario |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Definición inicial. Implementado en JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) La definición de 'Math.LN2' en esta especificación. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) La definición de 'Math.LN2' en esta especificación. |
Standard | |
ECMAScript (ECMA-262) La definición de 'Math.LN2' en esta especificación. |
Living Standard |
Compatibilidad con navegadores
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.