How to store extremely large numbers?

前端 未结 4 946
情书的邮戳
情书的邮戳 2020-11-27 06:26

For example I have a factorial program that needs to save really huge integers that can be 50+ digits long. The absolute maximum primitive data type in C++ is unsigned

4条回答
  •  余生分开走
    2020-11-27 07:17

    You'll have to use a bigint or bignum implementation. There are some libraries out there like this: http://gmplib.org/

    Some more info and a list of libraries: http://en.wikipedia.org/wiki/Bignum

提交回复
热议问题