大的伪随机数 [英] Large pseudo random numbers

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

问题描述

我希望我能在这里得到一些关于多个精度整数的指示。

我的讲师给了我们一个关于使用java大整数类的任务。


我用计算器计算2到128的幂,结果是:

3.4028236692093846346337460743177e + 38

这个'e + 38'是什么意思?


如何在程序中处理多个精度数字?


请与我分享一些关于这个主题的信息

....谢谢。

I hope I can get some pointers about multiple precision integers in here.
My lecturer has given us a task about using java big integer class.

I use calculator to calculate 2 to the power of 128 and result is this:
3.4028236692093846346337460743177e+38
What does this ''e+38'' mean?

How multiple precision numbers are being processed in a program?

Kindly please share some info about this subject with me
....Thank You.

推荐答案


我希望我能在这里得到一些关于多个精度整数的指针。

我的讲师给了我们一个关于使用java大整数的任务上课。


我用计算器来计算2到128的幂,结果是:

3.4028236692093846346337460743177e + 38

这个e + 38是什么意思?


如何在程序中处理多个精度数字?


请与我分享一些关于这个主题的信息

....谢谢。
I hope I can get some pointers about multiple precision integers in here.
My lecturer has given us a task about using java big integer class.

I use calculator to calculate 2 to the power of 128 and result is this:
3.4028236692093846346337460743177e+38
What does this ''e+38'' mean?

How multiple precision numbers are being processed in a program?

Kindly please share some info about this subject with me
....Thank You.



''e + 38''符号表示10次加权38次。你的浮动

点数近似为2 ** 128(**是我加权的表示法。


您可以使用BigInteger数字这可以计算,嗯,非常大

整数;阅读有关BigInteger类API文档的所有信息,并特别注意 pow 方法。


亲切的问候,


Jos

The ''e+38'' notation means ''times ten raised to the power 38''. Your floating
point number approximates 2**128 (** being my notation for ''raise to the power).

You can use BigInteger numbers for this which can calculate, well, very big
integer numbers; read all about the BigInteger class API docs and pay special
attention to the pow method.

kind regards,

Jos



''e + 38''符号表示''十次加注到权力38''。你的浮动

点数近似为2 ** 128(**是我加权的表示法。


您可以使用BigInteger数字这可以计算,嗯,非常大

整数;阅读有关BigInteger类API文档的所有信息,并特别注意 pow 方法。


亲切的问候,


Jos
The ''e+38'' notation means ''times ten raised to the power 38''. Your floating
point number approximates 2**128 (** being my notation for ''raise to the power).

You can use BigInteger numbers for this which can calculate, well, very big
integer numbers; read all about the BigInteger class API docs and pay special
attention to the pow method.

kind regards,

Jos



谢谢Jos。感谢您回答我的问题。

由于我刚刚找到一个网站,它也被称为十进制指数表示法。


我可以告诉你使用scien吗?计算它只能显示直到32个十进制数字,不是吗?


关于这个主题和随机数生成器的另一个问题。

您能否看一下下面的源代码,为什么它产生的数字只在最后4位数上有所不同?


我可以从这段代码中得到最小范围的随机数= 0,

就像是:0 - 2 ** 49随机数字?


我从命令提示符提供49个numDigits ......

谢谢

Prime 1 = 7729326601200590308083947455996107344624824341311
$ b $乙素2 = 7729326601200590308083947455996107344624824341503
$ b $乙素3 = 7729326601200590308083947455996107344624824341643
$ b $乙素4 = 7729326601200590308083947455996107344624824341653
$ b $乙素5 = 7729326601200590308083947455996107344624824341721
$ b $乙素6 = 7729326601200590308083947455996107344624824341823
$ b $乙素7 = 7729326601200590308083947455996107344624824341989
$ b $乙素8 = 7729326601200590308083947455996107344624824342009
$ b $乙素9 = 7729326601200590308083947455996107344624824342049

展开 | 选择 | Wrap | 行号



关于这个主题和随机数生成器的另外一个问题。

您能否看一下下面的源代码,为什么它产生的数字只在最后4位数上有所不同?
One more question regarding this subject and random number generators.
Could you please take a look at the below source code, why it produces numbers only differs at the last 4 digits?



因为您在main方法中创建了一个起始编号,然后在该起始编号上调用方法nextPrime(...)十次,在该编号之后获得下一个素数。这样你可以获得十个(可能的)素数,这些素数(如果足够大)只是在最后的数字上有所不同。


Because you create a starting number in your main method and then call the method nextPrime(...) ten times on that starting number getting the next prime after that number. That way you get ten increasing number of (probable) primes, which (if large enough) only differ in their last digits.



我可以从这段代码得到最小范围的随机数= 0,它就像是:0 - 2 ** 49个随机数?
Is it possible for me to get min range of random number =0 from this code, it is like from: 0 - 2**49 random numbers?



如果你想要一个0到2 ** 49之间的(伪)随机BigInteger,你可以在你的main方法中这样做:

If you want a (pseudo) random BigInteger between 0 and 2**49, you could just do this in your main method:

展开 | 选择 | Wrap | 行号


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

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