3 ms·
Reminds me of: Professor asked us to find the biggest factorial using C programming language. And then using LISP. You can imagine our surprise.
by pagade 18d ago
Reminds me of: Professor asked us to find the biggest factorial using C programming language. And then using LISP. You can imagine our surprise.
- pkaye 18d agoThere is a algorithm call Prime Swing Factorial that can compute large factorials exactly in arbitrary precision math using prime factorization. Like 10000000! in under second depending of how optimized the math library it. Probably like 100x faster than the normal method.
- anthk 18d agoWith Lisp you can use iterative algos and get that under a second too. SBCL can be ridiculously fast; and if you optimize the compilation for integers... the speed gets really close to your solution.
- flcikfinder 18d ago[flagged]
- smcin 17d ago(I just undead'ed this comment; can't see why it was downvoted.)
- smcin 17d agoI think you mean "using base C without any arbitrary-precision library (e.g. GMP)" . All that illustrates is that Lisp has built-in support for arbitrary-precision arithmetic, whereas C doesn't. Otherwise, how is this surprising, and what is the reason for the performance difference?