> 数学 >
求高手解析tmp =Math.floor(Math.random()*4);什么意思?
人气:256 ℃ 时间:2020-08-26 17:56:32
解答
Math.random() 是得到一个0-1之间随机数.
Math.floor(i) 是得到一个数的整数部分
Math.random()*4的值是[0-4)之间的随机数
tmp就是指随机出来的一个整数0,1,2,3其中的一个
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版