ES6 - Math exp() 函式



等價於 Math.pow(Math.E, x)。

語法

Math.exp ( x ) ;   

引數

  • x − 表示一個數字

返回值

返回變數 x 的指數值。

示例

console.log("---Math.exp()---") 
console.log("Math.exp(1) : "+Math.exp(1)) 
console.log("Math.exp(5.5) : "+Math.exp(5.5))          

輸出

---Math.exp()--- 
Math.exp(1) : 2.718281828459045 
Math.exp(5.5) : 244.69193226422036             
廣告

© . All rights reserved.