日期:2014-05-17  浏览次数:20733 次

(Math.floor(Math.random()*3)==0))是什么?
这个是判断随机30%的概率吗?要50%的概率怎么改?

------解决方案--------------------
java api里面对Math.random()的说明
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. 
Math.floor()的说明
Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.