且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何存储极大数字?

更新时间:2023-11-13 15:29:52

如果你已经有一个boost依赖(这些天,很多人都这样做),你可以使用boost 多精度库。事实上,它已经有一个例子: factorial program ,它可以支持高达128位的输出,虽然扩展更多是非常微不足道的。

If you already have a boost dependency (which many people these days do), you can use the boost multi-precision library. In fact, it already has an example of a factorial program that can support output up to 128 bits, though extending it further is pretty trivial.