学习笔记-js Math

<body>
  <script>
    //math对象
    //Math.ceil(num) 向上取整 即大于num的最小整数
    //Math.floor(num) 返回整数部分
    //Math.round(num)  四舍五入
    //Math.abs(num) 绝对值
    //Math.random() 取0-1之间的一个随机数(大于等于0,小于1)
    //n-m之间的随机数 Math.floor((m-n+1)*Math.random()+n)
    
  </script>
</body>

 

posted @ 2020-07-05 17:09  小余猪  阅读(154)  评论(0)    收藏  举报