ES6 - Math.log(x) 函式



返回 X 的自然對數。

語法

Math.log(x)    

引數

  • X − 表示一個數字

例項

console.log("---Math.log()---") 
console.log("Math.log(Math.E): "+Math.log(Math.E)) 
console.log("Math.log(17.5): "+Math.log(17.5))         

輸出

---Math.log()--- 
Math.log(Math.E): 1 
Math.log(17.5): 2.8622008809294686           
廣告
© . All rights reserved.