国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

老師,隨機(jī)問(wèn)題用floor方法,永遠(yuǎn)取不要最大值,為什么不用round?
RJ
RJ 2017-02-21 17:06:39
0
2
1261

Math.floor(Math.random()*(max-min)+min);//取不到max

Math.round(Math.random()*(max-min)+min);//可以取到min,也可以取到max,更合理一點(diǎn)



RJ
RJ

reply all(2)
數(shù)據(jù)分析師

Teacher, use the floor method for random questions and never take the maximum value. Why not use round? -PHP Chinese website Q&A-Teacher, use the floor method for random questions and never take the maximum value. Why not use round? -PHP Chinese website Q&A

Let’s take a look and learn.

阿神

嗯,是的,確實(shí)更合理點(diǎn),你思考的很仔細(xì)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template