Math.LN2
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
La propiedad Math.LN2
representa el logaritmo natural de 2, aproximadamente 0.693:
Pruébalo
function getNatLog2() {
return Math.LN2;
}
console.log(getNatLog2());
// Expected output: 0.6931471805599453
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® 2025 Language Specification # sec-math.ln2 |
Compatibilidad con navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LN2 |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.