A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Math/LN10 below:

Math.LN10 - JavaScript | MDN

Math.LN10

Baseline Widely available

Math.LN10 靜態數據屬性表示 10 的自然對數值,約為 2.303。

嘗試一下
function getNatLog10() {
  return Math.LN10;
}

console.log(getNatLog10());
// 預期輸出:2.302585092994046
值 𝙼𝚊𝚝𝚑.𝙻𝙽𝟷𝟶 = ln ( 10 ) ≈ 2.303 \mathtt{Math.LN10} = \ln(10) \approx 2.303 可寫 否 可列舉 否 可配置 否 描述

由於 LN10 是 Math 的靜態屬性,因此你應始終以 Math.LN10 的方式使用,而非作為某個 Math 物件的屬性(Math 並不是建構子)。

範例 使用 Math.LN10

以下函式返回 10 的自然對數值:

function getNatLog10() {
  return Math.LN10;
}

getNatLog10(); // 2.302585092994046
規範 瀏覽器相容性 參見

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4