JavaScript中的Math.sqrt()函数
sqrt()Math对象的函数接受一个数字,并返回给定数字的平方根值。
语法
其语法如下
Math.sqrt();
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.sqrt(169);
document.write("Square root value of the given number: "+result);
</script>
</body>
</html>输出结果
Square root value of the given number: 13