首页 > 编程 > JavaScript > 正文

JS数学函数Exp使用说明

2019-11-20 23:18:45
字体:
来源:转载
供稿:网友

计算ex摘要

Math.exp(x)
参考
x
数值或表达式,被用作指数。

返回值

ex,即e的x次幂。这里e代表自然对数的底数,其近似为2.71828。

exp()语法如下:

复制代码 代码如下:
Math.exp(x) ;

Math.exp()范例:
复制代码 代码如下:

<script language='JavaScript' type='text/JavaScript'>
<!--
document.write(Math.exp(2)); // output is 7.38905609893065
document.write("<br>");
document.write(Math.exp(1)); // output is 2.718281828459045
document.write("<br>");
document.write(Math.exp(-2)); // output is 0.1353352832366127
document.write("<br>");
document.write(Math.exp(.25)); // output is 1.2840254166877414
document.write("<br>");
document.write(Math.exp(-0.46)); // output is 0.631283645506926
//-->
</script>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表