Math.LN10

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.LN10 プロパティは 10 の自然対数、およそ 2.302 を表します。

Math.LN10 = ln ( 10 ) 2.302 \mathtt{\mi{Math.LN10}} = \ln(10) \approx 2.302

試してみましょう

Math.LN10 のプロパティ属性
書込可能 不可
列挙可能 不可
設定可能 不可

解説

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

Math.LN10 の使用

以下の関数は、10 の自然対数を返します。

js
function getNatLog10() {
  return Math.LN10;
}

getNatLog10(); // 2.302585092994046

仕様書

Specification
ECMAScript Language Specification
# sec-math.ln10

ブラウザーの互換性

BCD tables only load in the browser

関連情報