首页 >

vue中的math.sqrt的用法是什么

web前端|Vue.jsvue中的math.sqrt的用法是什么
vue
web前端-Vue.js
java 的威客平台源码,vscode快速格式化es,ubuntu vim模式,tomcat部署要重启,爬虫展伦敦,php客服机器人,郴州百度seo优化推广,磁贴风格网站lzw
本文操作环境:windows10系统、Vue2.9.6版,DELL G3电脑。
刷单管理网站源码下载,ubuntu重启时卡住,tomcat指定路径不正确,python爬虫删除某行,怎样使用php构建网站,嘉兴英文seolzw
vue中的math.sqrt的用法是什么
粽子授权系统源码,ubuntu编译安装edk,爬虫爬网页格式,php多商家,seo 单页lzw
sqrt() 方法返回数的平方根。

语法为:

Math.sqrt(x)

如果 x 是负数,则返回 NaN。

示例如下:

  var a = Math.sqrt(0);  var b = Math.sqrt(1);  var c = Math.sqrt(9);  var d = Math.sqrt(64);  var e = Math.sqrt(-9);

输出结果:

0138NaN

扩展知识:

Math内置的方法

// Math的内置方法// 1 random()返回0~1的数字,不包含1console.log(Math.random());// 2 round()返回一个四舍五入的数字console.log(Math.round(1.6)); // 2// 3 abs()console.log(Math.abs(-2.566)); // 2.566// 4 floor()console.log(Math.floor(2.3)); // 2// 5 ceil()console.log(Math.ceil(2.1)); // 3// 6 max() minconsole.log(Math.max(1,2,3,7,8,9,5)); // 9console.log(Math.min(1,2,3,7,8,9,5)); // 1// 7 PIconsole.log(Math.PI); // 3.141592653589793// 8 pow(底数,次方)console.log(Math.pow(2,3)); 8// 9 sqrt()console.log(Math.sqrt(4)); // 2

  • 暂无相关文章
  • Posted in 未分类