开发者

PHP integer exponentiation (super large numbers)

Using PHP I want开发者_如何学Go to do millions of 2^n exponentiation but so far I only got up to n^1023 before PHP printed INF.

Any ideas?


As Greg said, BC Math is fine, but if you really need efficiency, try GMP instead.


You can use the BC Math functions:

  $num = bcpow(2, 1000000); // Takes a few seconds to run!
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜