MCPcopy Index your code
hub / github.com/python/cpython / factorial

Function factorial

Modules/_decimal/tests/bench.py:59–67  ·  view source on GitHub ↗
(n, m)

Source from the content-addressed store, hash-verified

57 return s
58
59def factorial(n, m):
60 if (n > m):
61 return factorial(m, n)
62 elif m == 0:
63 return 1
64 elif n == m:
65 return n
66 else:
67 return factorial(n, (n+m)//2) * factorial((n+m)//2 + 1, m)
68
69# Fix failed test cases caused by CVE-2020-10735 patch.
70# See gh-95778 for details.

Callers 1

test_factorialFunction · 0.70

Calls

no outgoing calls

Tested by 1

test_factorialFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…