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.
我需要在 C 程序中将一个非常大的数字存储为整数,unsigned long int但仍然太小,我需要一个仍然可以与模运算符 (%) 一起使用的非常大的数据类型。
unsigned long int
有几个库可以做到这一点
如果您需要它用于加密目的(例如,您需要模算术暗示的 RSA),OpenSSL BN 非常适合
我只想扔另一个库来解决这个问题,我刚刚完成:
它比前面提到的库更轻量级。请确保它仍然可以解决您的需求,因为存在一些限制。
作为一个例子,你可能会做这样的模运算:
char i[20] = "5005"; kmbint_mod(i, "10"); // i is now "5"