Math.LOG2E

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.

Math.LOG2E プロパティは 2 を底とした e の対数、約 1.442 を表します。

試してみましょう

function getLog2e() {
  return Math.LOG2E;
}

console.log(getLog2e());
// Expected output: 1.4426950408889634

Value

𝙼𝚊𝚝𝚑.𝙻𝙾𝙶𝟸𝙴=log2(e)1.442\mathtt{Math.LOG2E} = \log_2(\mathrm{e}) \approx 1.442
Math.LOG2E のプロパティ属性
書込可能不可
列挙可能不可
設定可能不可

解説

LOG2EMath オブジェクトの静的プロパティなので、 Math オブジェクトを生成してプロパティとして使用するのではなく、常に Math.LOG2E として使用するようにしてください (Math はコンストラクターではありません)。

Math.LOG2E の使用

以下の関数は、2 を底とした e の対数を返します。

js
function getLog2e() {
  return Math.LOG2E;
}

getLog2e(); // 1.4426950408889634

仕様書

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

ブラウザーの互換性

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
LOG2E

Legend

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

Full support
Full support

関連情報