如何在 JavaScript 中獲取 E 的 2 為底的對數?


若要獲取 E 的 2 為底的對數,請使用 Math LOG2E 屬性。它返回 E 的 2 為底的對數,約為 1.442。

示例

你可以嘗試執行以下程式碼來在 JavaScript 中獲取 E 的 2 為底的對數

<html>
   <head>
      <title>JavaScript Math LOG2E Property</title>
   </head>
   <body>
      <script>
         var property_value = Math.LOG2E
         document.write("Property Value is : " + property_value);
      </script>
   </body>
</html>

更新於: 16-Jan-2020

228 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告