如何表示大于 (10^6) 的整数!用于在java中求解方程
我们如何求解具有 N! 的方程?其中的常量,其中 N 的范围可以是 1<=N<=10^6 BigInteger 最多只能执行 128 位,对吗?
即使两边都取对数,留下的值也比 BigInteger 大。
How can we solve equations having N! constants in it , where N can be of range 1<=N<=10^6
BigInteger can only perform upto 128 bits right?
Even when one do logarithm on both sides, it leaves values bigger than BigInteger.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,
BigInteger
可以处理任意大小的整数(受内存限制)。来自文档:(强调我的观点。)
这并不是说 BigInteger 一定是满足您需求的正确答案,但在做出决定之前了解其真正的功能是值得的。
No,
BigInteger
can handle arbitrary sizes of integer (limited by memory). From the documentation:(Emphasis mine.)
That's not to say that
BigInteger
will necessarily be the right answer to your requirements, but it's worth being aware of its real capabilities before deciding.让 N=10^6
这可以(很容易)适合 int
let N=10^6
this can (easily) fit in int
BigInteger 的实现限制为大约 2 ^ 21 亿位或大约 256 MB。鉴于其使用
int
位长度,这一数字不太可能增加。The implementation of BigInteger is limited to around 2 ^ 2.1 billion bits or about 256 MB. Given its used of
int
for bit lengths, this is unlikely to increase.