Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨我想计算
2^(256bit number)
在 java 中,但 biginteger 的 pow 函数只能处理整数。
我如何计算更大的数字?
有图书馆吗?
我想计算所有数字
2^0 2^1 2^2 ... 2^(10^77)
我怀疑他们没有费心包括这样的事情的原因是在大多数情况下,这个数字太大而无法代表。
考虑 2^(256 位数)。结果有(256 位数字)位,这意味着它需要比宇宙中的粒子更多的内存。
所以你必须找到一种不同的方式来表示你的逻辑。也许你可以象征性地做到这一点。
可以做 2^(2^32) 和接近它的指数,但这可能被视为一个小众案例,他们只是没有费心为其添加函数。