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:
Property attributes of Math.LN2 | |
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
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 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.