什么是最快的算法进行疯狂的大整数的除法?除法、整数、算法、最快

2023-09-11 22:38:17 作者:囚心锁

我需要划分数重新psented作为字节数组的字节非标量位$ P $。它也许5个字节或1 GB或更多。司应重新psented作为字节数组$ P $的数字来完成,无需任何转换为​​数字。

I need to divide numbers represented as digits in byte arrays with non standard amount of bytes. It maybe 5 bytes or 1 GB or more. Division should be done with numbers represented as byte arrays, without any conversions to numbers.

推荐答案

分而治之师风了是一大堆比教科书的方法非常大的整数更快。

Divide-and-conquer division winds up being a whole lot faster than the schoolbook method for really big integers.

GMP 是国家的最先进的大数字图书馆。对于刚才的一切,它有不同的算法几个实现,分别调整为特定的操作数大小。

GMP is a state-of-the-art big-number library. For just about everything, it has several implementations of different algorithms that are each tuned for specific operand sizes.

这里是GMP的除法算法的文档。该算法描述是有点简洁,但他们至少给你的东西,当你想了解更多的谷歌。

Here is GMP's "division algorithms" documentation. The algorithm descriptions are a little bit terse, but they at least give you something to google when you want to know more.

Brent和齐默尔曼的现代计算机运算是一本好书的理论和实施大数量的算术。也许值得如果你想知道什么是已知的一读。

Brent and Zimmermann's Modern Computer Arithmetic is a good book on the theory and implementation of big-number arithmetic. Probably worth a read if you want to know what's known.