Math.random()* n [英] Math.random() * n

查看:118
本文介绍了Math.random()* n的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Math.random()* 1000和Math.random()* 256做什么?

What do Math.random() * 1000 and Math.random() * 256 do?

推荐答案

它只是生成一个介于0.0和乘数之间的随机数. ,在这种情况下为1000或256.
It just generates a random number between 0.0 and the multiplier, in this case 1000 or 256.


为什么要在问题论坛中而不是在编译器中键入这些内容,然后查看它们的作用?您没有要阅读的参考书吗?您如何在没有任何参考的情况下学习Java?
Why would you type those things into a questions forum and not into your compiler, and SEE what they do ? Do you not have any reference books to read ? How can you learn java without any references ?


这篇关于Math.random()* n的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆