biginteger – 大数分部

除了学校方法之外,还有更快的方法来划分大整数(1000位或更多)吗?

解决方法

维基百科列出 multiple division algorithms.见 Computational complexity of mathematical operations,其中 Schoolbook long division为O(n ^ 2),Newton’s method为M(n),其中M是所用乘法算法的复杂度,可以与O一样好(n log n 2 ^( log*n)渐渐地.

one of the multiplication algorithms的讨论中注意到,渐近的最佳算法不一定是“小”输入的最快算法:

In practice the Schönhage–Strassen algorithm starts to outperform older methods such as Karatsuba and Toom–Cook multiplication for numbers beyond 2^(2^15) to 2^(2^17) (10,000 to 40,000 decimal digits). The GNU Multi-Precision Library uses it for values of at least 1728 to 7808 64-bit words (111,000 to 500,000 decimal digits),depending on architecture. There is a Java implementation of Schönhage–Strassen which uses it above 74,000 decimal digits.

相关文章

自1998年我国取消了福利分房的政策后,房地产市场迅速开展蓬...
文章目录获取数据查看数据结构获取数据下载数据可以直接通过...
网上商城系统MySql数据库设计
26个来源的气象数据获取代码
在进入21世纪以来,中国电信业告别了20世纪最后阶段的高速发...