Math.random()*5+1是什么意思?

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/13 17:02:12

Math.random()*5+1是什么意思?

产生1.00-6.00的double型小数
最好用Math.round(Math.random()*5+1)
产生1-6的int类型的数