MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / division

Function division

codes/python/Code_4_06_6.py:12–13  ·  view source on GitHub ↗
(a, b, m)

Source from the content-addressed store, hash-verified

10
11# division(a, b, m) は a÷b mod m を返す関数
12def division(a, b, m):
13 return (a * modpow(b, m - 2, m)) % m
14
15# ncr は n! を r! × (n-r)! で割った値
16def ncr(n, r):

Callers 1

ncrFunction · 0.70

Calls 1

modpowFunction · 0.70

Tested by

no test coverage detected