时间:2015-06-15 11:19作者:zhao人气:29
此方法返回 Ex, 其中x是参数,E是欧拉不变,自然对数的底数。
语法
Math.exp( x ) ;
下面是参数的详细信息:
x : 一个数字.
返回值:
返回变量x的指数值
例子:
<html>
<head>
<title>JavaScript Math exp() Method</title>
</head>
<body>
<script type="text/javascript">
var value = Math.exp(1);
document.write("First Test Value : " + value );
var value = Math.exp(30);
document.write("<br />Second Test Value : " + value );
var value = Math.exp(-1);
document.write("<br />Third Test Value : " + value );
var value = Math.exp(.5);
document.write("<br />Fourth Test Value : " + value );
</script>
</body>
</html>
这将产生以下结果:
First Test Value : 2.718281828459045
Second Test Value : 10686474581524.462
Third Test Value : 0.36787944117144233
Fourth Test Value : 1.6487212707001282
网友评论