2 ms·
The Python function is implemented in C and uses a faster algorithm [1], and this particular factorial is so small they put it in a lookup table [2]. It is a s
by mkl 1y ago
The Python function is implemented in C and uses a faster algorithm [1], and this particular factorial is so small they put it in a lookup table [2]. It is a strange and very unequal choice for a demo.
[1] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a333940ebf4dc2a74e15/Modules/mathmodule.c#L1819 https://github.com/python/cpython/blob/0d9d48959e050b66cb37a...
[2] https://github.com/python/cpython/blob/0d9d48959e050b66cb37a333940ebf4dc2a74e15/Modules/mathmodule.c#L1992 https://github.com/python/cpython/blob/0d9d48959e050b66cb37a...