大数除法

发布于 2025-01-04 23:17:29 字数 42 浏览 2 评论 0原文

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

Is there any faster method for division of large integers(having 1000 digits or more) other than the school method?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

近箐 2025-01-11 23:17:29

维基百科列出了多种除法算法。请参阅数学运算的计算复杂性,其中列出了教科书长除法O(n^2)牛顿法M(n) 其中 M 是所使用乘法算法的复杂度,可能与 O(n log n 2^(log*n)) 渐近。

请注意一种乘法算法的讨论对于“小”输入,最好的渐近算法不一定是最快的:

在实践中,对于超过 2^(2^15) 到 2^(2^17)(10,000 到 40,000 个十进制数字)的数字,Schönhage–Strassen 算法开始优于旧方法,例如 Karatsuba 和 Toom–Cook 乘法。 GNU 多精度库将其用于至少 1728 到 7808 64 位字(111,000 到 500,000 个十进制数字)的值,具体取决于体系结构。 Schönhage–Strassen 有一个 Java 实现,它使用超过 74,000 位十进制数字。

Wikipedia lists multiple division algorithms. See Computational complexity of mathematical operations which lists Schoolbook long division as O(n^2) and Newton's method as M(n) where M is the complexity of the multiplication algorithm used, which could be as good as O(n log n 2^(log*n)) asymptotically.

Note from the discussion of one of the multiplication algorithms that the best algorithm asymptotically is not necessarily the fastest for "small" inputs:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文