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.

A propriedade Math.LN2 representa o logaritmo natural (também conhecido como logaritmo neperiano) de 2, que é aproximadamente 0.693:

Math.LN2=ln(2)0.693\mathtt{\mi{Math.LN2}} = \ln(2) \approx 0.693
Property attributes of Math.LN2
Writableno
Enumerableno
Configurableno

Descrição

Por LN2 ser uma propriedade estática de Math, deve-se sempre usá-la como Math.LN2, e não como uma propriedade de um objeto Math que você criou.

Exemplos

Usando Math.LN2

A função a seguir retorna o logaritmo natural de 2:

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

getNatLog2(); // 0.6931471805599453

Especificações

Specification
ECMAScript® 2025 Language Specification
# sec-math.ln2

Compatibilidade com navegadores

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
LN2

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Veja também