JS Math常用方法

Math

  1.Math.abs() 获取绝对值;
  2.Math.round() 四舍五入;
  3.Math.random()  0~1随机小数;
  4.Math.ceil() Math.floor() 向上取整和向下取整;
  5.Math.max() Math.min()  最大最小值;
  6.Math.PI   圆周率;
  7.Math.pow(a,b)  a的b次幂  Math.aqrt(a)  a开方
posted @ 2020-12-23 14:46  helloSWZ  阅读(145)  评论(0)    收藏  举报