这个方法返回一个数的平方根。如果数的值是负的,开方返回nan。
语法
math.sqrt( x ) ;
下面是参数的详细信息:
x: 一个数字返回值:
返回一个数字的正弦值。例子:
javascript math sqrt() method
这将产生以下结果:
first test value : 0.7071067811865476second test value : 9third test value : 3.605551275463989fourth test value : nan