用户:
名探酱查看:3 回复:1 评论:3 创建时间:2022-10-30T14:15:35
如题,请问大家随机数的代码在岛三是什么?
(Math.random())吗? 可是这个值填啥?
SKQAMath.random() //返回0到1 的随机小数
Math.random()*2 //返回0到2 的随机小数
Math.random()*114514 //返回0到114514的随机小数
2+Math.random()*5 //返回2到7 的随机小数
Math.floor(2+Math.random()*5) //返回向下取整的2到7随机小数,也就是2到6随机整数
Math.round(2+Math.random()*5) //返回四舍五入的2到7随机小数,也就是2到7随机整数点赞0
评论