Closed stone-zeng closed 9 months ago
大佬太强了。
最后一题,用 C++
写直接乘法,我估计不出5个数就溢出了,MMA
是有什么神奇操作吗?
最后一题,用
C++
写直接乘法,我估计不出5个数就溢出了,MMA
是有什么神奇操作吗?
根据 MMA 的文档 https://reference.wolfram.com/language/ref/Factorial.html,
Factorial can be evaluated to arbitrary numerical precision.
在 Some Notes on Internal Implementation 中可以看到这样的说明:
n!
uses an O(log(n)M(n)) algorithm of Schönhage based on dynamic decomposition to prime powers.
https://stone-zeng.github.io/2020-08-07-euler-11-20/
欧拉计划 11–20 题。