ES6 - Math.expm1(x) 函式



等價於 Math.exp(x) - 1。

語法

Math.expm1( x );   

引數

  • x − 代表一個數字

返回值

返回 Math.exp(x) - 1 的值

示例

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

輸出

---Math.expm1()--- 
Math.expm1(1) : 1.718281828459045 
Math.expm1(5.5) : 243.69193226422038            
廣告