Math.random() //范围 [ 0 , 1 )
1、Math.round() // 四舍五入
Math.round(Math.random()*3) //范围 [ 0 , 4 ]
2、Math.ceil() // 全入
Math.ceil(Math.random()*3) //范围 [ 1 , 3 ]
3、Math.floor() // 全舍
Math.floor(Math.random()*4) //范围 [ 0 , 3 ]
Math.random() //范围 [ 0 , 1 )
1、Math.round() // 四舍五入
Math.round(Math.random()*3) //范围 [ 0 , 4 ]
2、Math.ceil() // 全入
Math.ceil(Math.random()*3) //范围 [ 1 , 3 ]
3、Math.floor() // 全舍
Math.floor(Math.random()*4) //范围 [ 0 , 3 ]