其他分享
首页 > 其他分享> > Math.ceil 、Math.floor 、 Math.random

Math.ceil 、Math.floor 、 Math.random

作者:互联网

向上取整 Math.ceil
//向下取整 Math.floor
//随机数(0-1) Math.random
// var num = 0.14;
// var num1 = 100;

// document.write(Math.ceil(num * num1)+ " ");//15
// document.write(Math.floor(num * num1)+ " ");//14
// document.write(Math.random(num * num1));//0-1之间随机数

标签:num1,floor,random,num,document,Math
来源: https://www.cnblogs.com/wsx123/p/16439458.html