--- title: Math.LOG2E slug: Web/JavaScript/Reference/Global_Objects/Math/LOG2E tags: - JavaScript - Math - Property - Propriedade - Reference - Referência(2) translation_of: Web/JavaScript/Reference/Global_Objects/Math/LOG2E ---
A propriedade Math.LOG2E representa o logaritmo com base 2 de e, aproximadamente 1.442:
Por LOG2E ser uma propriedade estática de Math, deve-se sempre usá-la como Math.LOG2E, e não como propriedade de um objeto Math criado por você (Math não é um construtor).
Math.LOG2EA função a seguir retorna o logaritmo com base 2 de e:
function getLog2e() {
return Math.LOG2E;
}
getLog2e(); // 1.4426950408889634
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Initial definition. Implemented in JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.8.1.4', 'Math.LOG2E')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.log2e', 'Math.LOG2E')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-math.log2e', 'Math.LOG2E')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.LOG2E")}}