Math.LN2

La propiedad Math.LN2 representa el logaritmo natural de 2, aproximadamente 0.693:

Math.LN2 = ln ( 2 ) 0.693 \mathtt{\mi{Math.LN2}} = \ln(2) \approx 0.693

Pruébalo

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:

js
function getNatLog2() {
  return Math.LN2;
}

getNatLog2(); // 0.6931471805599453

Especificaciones

Specification
ECMAScript Language Specification
# sec-math.ln2

Compatibilidad con navegadores

BCD tables only load in the browser

Ver también