随机数.. [英] random numbers..

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

问题描述

你好。


我想写自己的随机数生成器..谁能帮我解决问题?

解决方案


hello。


我想编写自己的随机数发生器..任何人都可以帮助我如何接近问题??






您是否在Google上搜索过?另请参阅


请粘贴到目前为止所做的事情。然后只有会员可以帮助你。


问候


zodilla58 :他没有任何代码可以发布 - 他不知道如何开始。如果你想成为一名警察,就去其他地方。


OP:你要问的第一个问题是,你想要什么样的随机数?


有真正的随机数,没有人可以预测。它们必须从某些物理过程中获得,例如抛硬币并存储结果,或查看时钟的最低位。


或者有伪随机数,其中是完全可预测的,但似乎随机一目了然。这些是使用数学函数生成的。


如果包含标准库,则有函数 random(someInteger),它将从0返回一个整数to someInteger。


我相信它是ravenspoint发布的第二种随机函数发生器(数学)。


Ras。

hello.

I want to write my own random number generator..can anyone help me how to approach the problem??

解决方案

hello.

I want to write my own random number generator..can anyone help me how to approach the problem??

Hi,

Have you searched on google? Also see this

Kindly paste what you have done so far. Then only members can help you.

Regards


zodilla58: He doesn''t have any code to post - he doesn''t know how to begin. If you want to be a policeman, go somewhere else.

OP: The first question you have to ask is, what kind of random numbers do you want?

There are real random numbers, which no-one can predict. They have to be obtained from some physical process, like tossing a coin and storing the results, or looking at the least significant bit of a clock.

Or there are psuedo random numbers, which are perfectly predictable but seem to nbe random at a glance. These are generated using a mathematical function.


If you include the standard library there is the function random(someInteger), that is going to return an integer from 0 to someInteger.

I believe it''s the second type of random function generator that ravenspoint posted (mathematical).

Ras.


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

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