无涯教程-SQRT2函数

107 阅读1分钟

2的平方根,大约为1.414。

SQRT2 - 语法

Math.SQRT2 

SQRT2 - 示例

console.log(Math.SQRT2)  //the square root of 2: ~1.414  
           

运行上面代码输出

1.4142135623730951             

参考链接

www.learnfk.com/es6/es6-mat…