问题描述
我工作的一个项目,我需要紧缩大整数(如3 ^ 361)以绝对precision并尽可能多的速度成为可能。 C是我熟悉的最快的语言,所以我试图code我在语言解决方案。
I am working on a project where I need to crunch large integers (like 3^361) with absolute precision and as much speed as possible. C is the fastest language I am familiar with, so I am trying to code my solution in that language.
问题是,我一直没能找到一个好的执行任何数据类型在C比Python的源$ C $ C等再presenting无限的整数。它正在我的时间去通过code和确定我需要什么。
The problem is that I have not been able to find a good implementation of any data types for representing limitless integers in C other than Python's source code. It is taking me time to go through the code and determine what I need.
我宁愿用别人的测试code有全套的功能(加,减,乘,除,调制,幂,平等检查......即使按位运算是甜)不是花费数周它会带我去甚至开始让我自己的版本达到标准。虽然这将是一个很好的学习经验,这不是我的问题的重点,我宁愿去我感兴趣的部分:)
I would much rather use someone else's tested code with a full set of functionality (addition, subtraction, multiplication, division, modulation, exponentiation, equality checking... even bitwise operation would be sweet) than spending the weeks it would take me to even begin to get my own version up to par. While it would be a great learning experience, it is not the focus of my problem, and I'd rather get to the part that interests me :)
推荐答案
提供BIGNUM库。
Gnu MP provides a bignum library.
这篇关于是否有任何C固态大整数实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!