JavaScript中使用指数方法Math.exp()的简介

2022-10-18,,,,

 此方法返回 ex, 其中x是参数,e是欧拉不变,自然对数的底数。
语法

math.exp( 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 

《JavaScript中使用指数方法Math.exp()的简介.doc》

下载本文的Word格式文档,以方便收藏与打印。