作业帮 > 数学 > 作业

Math.floor(Math.random() * 7 +

来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/05/15 14:41:08
Math.floor(Math.random() * 7 +
Math.random() 生成0和1之间的随机小数
Math.random() * 7 生成0和7之间的随机小数
Math.random() * 7 + 1生成0和8之间的随机小数
Math.floor(Math.random() * 7 + 1)生成0和8之间的随机整数,注意是整数,不是小数..